Developer Docs
OverviewGroupsPathways
  • Getting Started
  • Overview
    • API Manager
    • User Privacy
    • Responses
  • Groups
    • Concepts
    • Manage
    • Status
    • Insert
    • Remove
  • Data
    • Overview
    • List
    • Upload
    • Download
    • Delete
    • Insert
    • Remove
  • Pathways
    • Overview
    • Enrolments
      • List
      • Manage
    • Web Tracking
      • Serverless
      • Server-Side Platforms
    • Classroom & Events
      • List
      • Consume
    • Rewards
      • List
      • Consume
    • Webhooks
      • Enrolments
      • Classroom & Events
      • Rewards
    • Logs
      • Activity & Fulfilment Types
      • Activity & User Logs
  • Stories
    • Logs
      • Story Logs
      • User Story Logs
    • Certificates
    • Question Analysis
  • Streams
    • Subscriptions
    • Ratings
  • Analytics
    • Overview
    • Published
    • Realtime
    • Audience
      • Frequency
      • Demographics
      • Locations
      • Retention
    • Reviews
Powered by GitBook
On this page
  • API Standard Responses
  • Success
  • Handling a response example
  • Error
  1. Overview

Responses

API success and error responses

API Standard Responses

Our success and error responses have a consistent structure so that integrations to endpoints only have a binary path. The response is either successful, or there was an error.

Success

Our success responses will always be in the following format (unless explicitly documented differently on certain calls).

Key

Type

header

200 OK

status

String (success)

data

Array / Object / String (The endpoint response payload)

hash

String (A unique hash of the data response)

response_time

Float (How long the API call took in seconds)

Handling a response example

Our recommended implementation of a response is shown in the following example (done in basic syntax for simplicity):

if (response.status == "success"){
 // Do something with the data
 let data = response.data;
}
else{
 // Something went wrong.
 console.log(response.message);
}

Error

Key

Type

header

400 - 500

status

String (error)

message

String (A message detailing the error)

PreviousUser PrivacyNextConcepts

Last updated 3 years ago

Our error responses will always contain a "message" and "status". Header errors follow standard set at

https://en.wikipedia.org/wiki/List_of_HTTP_status_codes