saygent API documentation

We have a new API!

API v1 is still available, but we really recommend that you upgrade to v2. Not all of the functionality from v1 is available yet, but there is a lot that v1 doesn't have. Check it out!

API Base URL

https://www.saygent.com/api/v1

All API calls currently point to the above url for the first version of our API.

Authentication

auth_token=[YOUR TOKEN]

We will provide you with a private auth_token which is required for every API request.

JSON Response

We send a JSON response back for every request with at least a status message.

{ "status":"success" }
{ "status":"failure", "messages":{ "auth_token": "Authentication failed" } }

Rate Limit

Each auth_token has a limit of 200 requests per hour. If you require additional requests please send an email to api@saygent.com with your company name and requirements. We will do our best to accommodate your personal needs.

POST respondents
Example Request
{
  "auth_token":"abcdef"
  "survey_id":1234,
  "respondents":[
    {
      "phone":"111-111-1111",
      "first_name":"john",
      "last_name":"smith",
      "email":"johnsmith@example.com",
      "contact":{
        "by":"phone"
      }
    },
    {
      "phone":"222-222-2222,
      "email":"asdf.com"
    }
  ]
}
			
Example Response
{
  "status": "warning",
  "respondents": [
    {
      "id": 1,
      "phone": "111-111-1111",
      "first_name": "john",
      "last_name": "smith",
      "email": "johnsmith@example.com",
      "status": "created"
    },
    {
      "phone": "222-222-2222",
      "email": "asdf.com",
      "status": "failed",
      "messages": {
        "email": "Email not in a valid format"
      }
    }
  ]
}
			
GET respondents

https://www.saygent.com/api/v1/respondents

Example Request
{
  "auth_token": "asdfjkl",
  "respondent_ids": "1,2",
  "survey_id": "xyz123"
}
			
Example Response
{
  "status": "success",
  "respondents": [
    {
      "id": 1,
      "phone":"111-111-1111",
      "first_name":"john",
      "last_name":"smith",
      "email":"johnsmith@example.com"
    },
    {
      "id": 2,
      "phone": 555-555-5555,
      "email": "professor@planex.com"
    }
  ]
}
			
POST call

https://www.saygent.com/api/v1/call

Example Request
{
  "auth_token": "asbcdwwogw",
  "respondent_ids": [
    1, 2, 3
  ]
}
			
Example Response
{
  "status": "warning",
  "respondents": [
    {
      "id": 1,
      "status": "queued"
    },
    {
      "id": 2,
      "status": "invalid",
      "messages": {
        "id": "Respondent id invalid"
      }
    },
    {
      "id": 3,
      "status": "queued"
    }
  ]
}
			
GET status

https://www.saygent.com/api/v1/status

Example Request
  {
    "auth_token": "asdwodj",
    "respondent_ids": "1,2,3,4"
  }
  			
Example Response
  {
    "status": "warning",
    "respondents": [
      {
        "id": 1,
        "status": "called"
      },
      {
        "id": 2,
        "status": "surveyed",
      },
      {
        "id": 3,
        "status": "analyzed"
      },
      {
        "id": 4,
        "status": "invalid",
        "messages": {
        "phone": "Phone number is invalid"
      }				
    ]
  }