Skip to content

DynamicSignal/voicestorm-api-imageupload-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#Introduction

VoiceStorm is a platform that allows you to create advocacy communities for a brand, organization, or cause. Community managers source and distribute approved content to members. Members share the content on their social channels, thereby amplifying the brand message. Learn more at http://www.dynamicsignal.com.

##Purpose of this test package: While you can use the stock VoiceStorm manager and member hub with any VoiceStorm community, that allows to upload an image for existing posts for members. Few organizations might want to use VoiceStorm APIs (documented at dev.voicestorm.com) to upload an image for posts. This test package is intended to help you do just that.

This test package includes server to server calls to upload an image for existing post:

  1. Authenticate server side.
  2. Upload an image to the provided postId.
  3. Once the image is successfully uploaded it is viewable on both member and manager Apps.

You can use it as an example/guide to upload binary image from a form to use internally. This test package can be extended in many ways as you want like, adding the ability to create a post and then upload the image etc.,

##Download, install, and run to upload image:

To upload image for existing post of your own VoiceStorm instance, you will need to download the sample code and modify it to point at your own VoiceStorm instance. The guide below will walk you through this process in 4 steps:

  1. Set up your webserver to run and install the test package. Once installed properly, the test package will run against your VS instance.
  2. Contact Dynamic Signal and get your own VS instance and API credentials.
  3. Modify the test package in order to point it at your new VS instance.
  4. Test it!

The sample site uses REST APIs to make authentic calls to the server. Further reference docs and required documentation are available at http://dev.voicestorm.com/. Once you go through this guide, you should have enough background to upload an image to the available post or create a post and attach an image.

###Step 1: Set up webserver/environment

  1. Install WAMP, or comparable webserver.
    1. Actual requirements are:
      1. Webserver
      2. PHP
      3. CURL
      4. HTTPS cert
    2. No database is required
  2. Test the environment:
    1. Ensure CURL is installed.
    2. Ensure PHP is installed.
  3. Download the code to the desired directory within the WAMP file structure.

You should now be able to run the code. Try it by opening up your install location in a browser. Next, let’s get you set up on your own VoiceStorm instance.

###Step 2: Obtain your VoiceStorm instance

You will need to contact DS and request an instance of VoiceStorm with API access. Be sure you get the following from the DS rep:

  1. URL for the new community ([example].voicestorm.com)
  2. The Admin -> API should be visible in the manager application ([example].voicestorm.com/manage/api), and this information should be available in that tab:
    1. Access Token
    2. Token Secret
    3. REST API Base URL

###Step 3: Modify test package to point at your own VoiceStorm instance

Download the code to your machine, and make the following changes, using tokens and URLs found at Admin -> API ([example]voicestorm.com/manage/api).

File Code Line From API Page
config.php $voicestormAccessToken Access Token
$voicestormTokenSecret Token Secret
$voicestormBaseUrl REST API Base URL

Examples

$voicestormAccessToken="XXXXXXXXXXXXXXXXXXXX";
$voicestormTokenSecret= "XXXXXXXXXXXXXXXXXXXX";
$voicestormBaseUrl="https://[example].voicestorm.com/v1";

###Step 4: Testing

Please test the following:

Now you should be able to see a from that takes postId and Image. After you enter valid image and postId the image will be available for the post in member or manager App

Have any questions?

We are eager to hear them. Email us at info@dynamicsignal.com

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages