API Authentication

ProTexting Feed API requires authentication. Authentication by Developer API Key (access_token) is available. In order to use this method the access token should be appended to the requested URL as a get parameter.

API Host Address:

The Feed API Host Address is https://protexting.com/features/api

Request Operations

  • The requests are made using the application name, a method and additional arguments depending on the application. For example:
  • The following code for example will get the messages for a campaign with an Id = 17 for the Direct Voting application:
  • Requesting the above information using the developer API key:
  • The following php code is an example for a code using the above URL:
    //The api url to request from the Direct Voting app
    $url = "https://www.protexting.com/features/api/directVoting/results?campaign_id=17&access_token=c7ac888fc9ceb42aa69ff915eef754f9cbbb1111";
    //Your email
    $email = "test@protexting.com";
    //Your password
    $password = "jhsda872jsdat";

    // We send XML via CURL using POST with a http header of text/xml.
    $ch = curl_init($url);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($ch, CURLOPT_HEADER, 0);
    curl_setopt($ch, CURLOPT_HTTPGET, 1);
    curl_setopt($ch, CURLOPT_USERPWD, $email . ":" . $password);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 0);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);

    $result = curl_exec($ch);

    // Print CURL result.
    echo $result;

Response formats

Different response formats are available - JSON and XML. The default response format is JSON. To have XML response add format=xml to the arguments.

Response fields

The following XML is an example for a Direct Voting response:

<?xml version="1.0" encoding="utf-8"?>
<root version="1.0">
  <campaign_title>Favorite pen color</campaign_title>
  <pole_question>Whats your favoring pen color?</pole_question>
	<description>Blue pen with blue ink</description>
	<description>Red pen with red ink</description>
	<description>Green pen with green ink</description>

Parameters (args)

Field Type Description
campaign_id int The ID of your campaign. Available at App listing.
format string xml or json