Skip to content

DynamicSignal/voicestorm-api-php-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 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 member hub with any VoiceStorm community, that allows Member sign-in and profile creation many organizations want to use the VoiceStorm APIs (documented at dev.voicestorm.com) to sync existing user data from their own server to VoiceStorm community. This test package is intended to help you do just that.

This test package includes server to server calls to create/manage users, divisions and affiliations (profile questions) as below:

  1. Authenticate server side.
  2. Look up user in VoiceStorm by email address to modify divisions/affiliations (Profile Questions).
  3. If the user does not exist, create with First Name, Last Name, Password and email address.
  4. Remove any divisions assigned to the user.
  5. Set to the first existing division (You can extend it to custom divisions).
  6. Remove all the answers for profile questions.
  7. Set all the answers (You can extend this to include custom answers).

You can use it as an example/guide when syncing user data to VoiceStorm hub and can extend it to the way you actually want it.

##Download, install, and run to sync user data:

To sync user data to 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 make server to server calls to modify Users.

###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:

Enter non-existing email address and you should be able to see the new user with divisions and affiliations created. Now open manager app -> Members to see the newly created user with custom divisions and affiliations (Profile Questions).

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