Overview

Retrieves a specific offering category with the specified lD. The result of this GET request will be JSON-encoded representation of an offering category object. The object definition is provided below.

JSON Object Definition

The following is a full definition of all possible properties on the JSON object representing an offering category. For further details about these properties, see the Offering Category Object Reference.

{
  "id": "",
  "name": "",
  "description": "",
  "color": "",
  "orderIndex": 0
}

Examples

Retrieve Offering Category by ID

This example shows the retrieval of a single offering category by its identifier. Because it has an orderIndex value of 1, it would appear as the second item in a list of your organization’s offering categories.

Request
GET /dc/api/v5/offeringcategories/322881a721f0feaedcbc12876a4510e HTTP/1.1
Host: api.digitalchalk.com
Accept: application/json

Response
HTTP/1.1 200 OK
Content-type: application/json
Content-length: 456 

{
  "id": "322881a721f0feaedcbc12876a4510e",
  "name": "Sample offering category",
  "description": "A sample offering category with example values for all fields",
  "color": "#0c2188",
  "orderIndex": 1
}

Failure Cases

Below is a list of the most common failure scenarios your code should be prepared to handle. This list is not exhaustive.

Invalid ID

If there is no offering category resource located at the given URL, the server will issue a 404 Not Found response.

Request
GET /dc/api/v5/offeringcategories/INVALID_ID_HERE HTTP/1.1
Host: api.digitalchalk.com
Accept: application/json

Response
HTTP/1.1 404 Not Found
Content-type: application/json
Content-length: 55

{
	"errors": [ "No resource exists with the given id." ]
}

Reference