Skip to content

Instantly share code, notes, and snippets.

@Djuki
Created July 20, 2015 15:43
Show Gist options
  • Save Djuki/05662b3aa5494d224f9c to your computer and use it in GitHub Desktop.
Save Djuki/05662b3aa5494d224f9c to your computer and use it in GitHub Desktop.
Survey API documentation

User API

Create a new user

API point

https://surveyfunnel.io/api/v1/payplan/register

Method:

post

Header Fields

  • sig : Secret signature for authentication

Params

  • first_name : (required) Users first name
  • last_name : (required) Users last name
  • email : (required) User email
  • password : (required) User password
  • password_confirm : (required) Repeat password
  • group_name : Name of the group you want to put user in.
  • email_additional_html Base 64 encoded HTML will be added at the end od activation email

Examples

Create a new user in "Ryan Client" group using Guzzle 4 library

require "vendor/autoload.php";

use GuzzleHttp\Client;

$client = new Client();
$response = $client->post('https://surveyfunnel.io/api/v1/payplan/register', [
    'headers' => ['sig' => 'secret_signature'],

    'body' => [
        'first_name' => 'Mike',
        'last_name' => 'Josh',
        'email' => '[email protected]',
        'password' => 'my_pass',
        'password_confirm' => 'my_pass',
        'group_name' => 'Ryan Client'
    ]
]);

Create a new user in "Ryan Client" group using curl

$ch = curl_init();

$params = [
    'first_name' => 'First',
    'last_name' => 'Last',
    'email' => '[email protected]',
    'password' => 'my_pass',
    'password_confirm' => 'my_pass',
    'group_name' => 'Ryan Client'
];

$postURL = 'https://surveyfunnel.io/api/v1/payplan/register';

curl_setopt($ch, CURLOPT_URL, $postURL);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
curl_setopt($ch, CURLOPT_HTTPHEADER, array('sig:secret_signature'));

// Remove this when on production
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);

curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

Cancel user

API point

https://surveyfunnel.io/api/v1/payplan/cancel-user

Method:

post

Header Fields

  • sig : Secret signature for authentication

Params

  • user_email : (required) User email address
  • current_user_group : (required) Current group for this user
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment