#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:
- Authenticate server side.
- Upload an image to the provided postId.
- 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:
- Set up your webserver to run and install the test package. Once installed properly, the test package will run against your VS instance.
- Contact Dynamic Signal and get your own VS instance and API credentials.
- Modify the test package in order to point it at your new VS instance.
- 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
- Install WAMP, or comparable webserver.
- Actual requirements are:
- Webserver
- PHP
- CURL
- HTTPS cert
- No database is required
- Test the environment:
- Ensure CURL is installed.
- Ensure PHP is installed.
- 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:
- URL for the new community ([example].voicestorm.com)
- The Admin -> API should be visible in the manager application ([example].voicestorm.com/manage/api), and this information should be available in that tab:
- Access Token
- Token Secret
- 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