REST API: Requests


API Credentials

All requests to Betwext API endpoints require authentication via HTTP Basic authorization to establish identity. The username is your API Key (a 32 character string), and the password is your API Token (also a 32 character string). Both are found in your Betwext Broadcast profile page.


Most HTTP clients present a dialog or prompt requesting a username and password when asked for HTTP Basic auth. Most clients will also allow you to put the username and password in the URL itself. Example:


https://{API Key}:{API Token}@api.broadcast.betwext.com/2011-03-01/subscribers

Retrieving Resources with HTTP GET

You can retrieve a resource by GETing it's URL - you can even do it from a browser address bar.


GET Response Status Codes


  • 200 OK: The request was successful and the response body contains the representation requested.
  • 302 FOUND: A common redirect response; you can GET the representation at the URI in the Location response header.
  • 304 NOT MODIFIED: Your client's cached version of the representation is still up to date.
  • 401 UNAUTHORIZED: The supplied credentials, if any, are not sufficient to access the resource.
  • 404 NOT FOUND: You know this one.
  • 500 SERVER ERROR: We couldn't return the representation. Please try again.

Creating/Updating Resources with HTTP POST

Creating or updating a resource involves performing an HTTP POST to a resource URL. In the POST properties of the object you wish to update are represented as form urlencoded key/value pairs (browsers encode POSTs this way by default). If writing your own client, be sure to set the HTTP Content-Type header to "application/x-www-form-urlencoded" for your requests.


POST Response Status Codes


  • 201 OK: The request was successful, we updated the resource and the response body contains the representation.
  • 400 BAD REQUEST: The data given in the POST or PUT failed validation. Inspect the response body for details.
  • 401 UNAUTHORIZED: The supplied credentials, if any, are not sufficient to create or update the resource.
  • 404 NOT FOUND: You know this one.
  • 500 SERVER ERROR: We couldn't create or update the resource. Please try again.