Follow

URI Structure and Response

URIs for the REST API have the following basic structure:

http://[siteURL]/rest/[resourceName]

Where [siteURL] is the domain of your email platform, and [resourceName] is the name of the feature to use.

Results

The URI allows for the return of a collection of results, or an instance in the format:

  • Collection: http://[siteURL]/rest/[resourceName]
  • Instance by ID: http://[siteURL]/rest/[resourceName]/[id]
  • Instance with Filter: http://[siteURL]/rest/[resourceName]/[fieldName]=[value]

For example:

All Lists in an Account: http://mydomain.com/rest/lists

Specific List by the List ID: http://mydomain.com/rest/lists/5

Specific List Filtered by the List Name: http://mydomain.com/rest/lists?listName=myList

Response

The Resource returns an HTML Reponse Code along with the representation in the JSON response when feasible.  Some REST API resources support Pagination when multiple result sets are found. 

The available data depends on the Resource.  It includes any field that contains a value, including blank strings.  Blank strings appear in double quotes with no data ("").  Fields with a NULL value (no data ever set), are not returned in the JSON at all.  For example, if the Subscriber Company field has never been set, the Get Subscriber response does not include the Company field in the JSON results.

In addition, you can control the amount of data returned in the JSON response by using the body override filter.  By default, the Resource returns all available data (_body=true).  To return only data with non-blank values, set the override to:

_body=false

For example: 

All Lists in an Account: http://mydomain.com/rest/lists?_body=false

Specific List by the List ID: http://mydomain.com/rest/lists/5?_body=false

Specific List Filtered by the List Name: http://mydomain.com/rest/lists?listName=myList&_body=false

 

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

Powered by Zendesk