Collection

A collection is returned when a list is requested. The response payload for a collection is wrapped in extra metatags, whereas an instance only contains the entity information.

Example

The request below returns all of the Member Variables defined for this community. In this case the resource will not just return an array of Member Variables, instead that array will be embedded in a response envelope.

https://api.{region}.alida.com/v1/applications/{communityApiKeyName}/membervariables

Note:

Use the appropriate regional endpoint to ensure that you comply with your organization's privacy policy, and applicable laws and regulations. For details about the available regional endpoints, and how to identify your organization's region, see API Access.

The response envelope provides important metadata concerning the data, such as how to paginate through it.

Response envelope format

{
   "items": [
      <array of requested entities>
   ],
   "links": [
      {
         "href": <URL>,
         "rel": <first|last|prev|next>
      }
   ],
   "meta": {
      "limit": <integer>,
      "offset": <integer>,
      "count": <integer>
   }
}

The following table describes the properties in the response envelope:

Property Description
items

The actual data, which will be an array of whatever type of entity you requested.

links The links property provides useful URLs that can be used for pagination. Possible properties are:
  • first: the first page of results in this collection.
  • last: the last page of results in this collection.
  • prev: if applicable, the previous page of results relative to the current page.
  • next: if applicable, the next page of results relative to the current page.
meta The meta property provides other metadata pertaining to this request. Possible values are:
  • limit: the maximum number of entities that will be returned for the current page of results. The default is 20 and the maximum is 1000. For more information, see Paging.
  • offset: the number of entities that were skipped for the current page of results. For more information, see Paging.
  • count: the total number of entities that were found for the request.
Example: Pagination of a collection

...
   "links": [
      {
         "rel": "first",
         "href": "https://api.{region}.alida.com/v1/applications/{communityApiKeyName}/membervariables
      },
      {
         "rel": "prev"
      },
      {
         "rel": "last",
         "href": "https://api.{region}.alida.com/v1/applications/{communityApiKeyName}/membervariables
      },
      {
         "rel": "next",
         "href": "https://api.{region}.alida.com/v1/applications/{communityApiKeyName}/membervariables
      }
   ],
   "href": "https://api.{region}.alida.com/v1/applications/{communityApiKeyName}/membervariables
...