Making Requests

The Classy API is organized around REST and the REST architectural style to provide developers with a stateless and language agnostic interface. Our API is designed to use HTTP verbs, resource-oriented URLs and common HTTP errors for communication and to convey errors in the API.

Action HTTP Method Idempotent Description
Create
POST /resource
No Creates a resource record of the corresponding type
List
GET /resource
Yes Returns a collection of resources that match the requested resource. Collection requests can be modified to apply filtering rules and responses will handle pagination.
Retrieve
GET /resource/{id}
Yes Returns comprehensive information for the single resource that matches the given ID.
Update
PUT /resource/{id}
Yes Modifies an existing resource that matches the specified ID.
Delete
DELETE /resource/{id}
Yes Deletes an existing resource that matches the specified ID. Deleted resources cannot be retrieved. Some resources may only allow 'soft deletes', in which case you will need to update the resource with the appropriate state or status. Refer to the API reference documentation for the specific resource.

Authenticating Requests

Most API requests will need to be signed with an Access Token. See Authentication for Access Token usage.

Refer to the Resource Documentation for the specific call you are making to see if an access token is required for your request.

Work With Resources

Fetching a Resource

To fetch a single resource, the request:

GET /2.0/resource/{resource_id} HTTP/1.1 Host: api.classy.com Authorization: Bearer a2eccdb8B35c

Example JSON response:

HTTP/1.1 200 OK Content-Type: application/json { "id": 1, "attribute_name": attribute_value }

Creating a Resource

Example request

POST /2.0/resource HTTP/1.1 Host: api.classy.org Content-Type: application/json; charset=utf-8 Authorization: Bearer a2eccdb8B35c { "attribute_name": attribute_value }

Example response:

HTTP/1.1 200 OK Content-Type: application/json { "id": 1, "attribute_name": attribute_value }

Updating a Resource

Example request:

PUT /2.0/resource/{resource_id} HTTP/1.1 Host: api.classy.org Content-Type: application/json; charset=utf-8 Authorization: Bearer a2eccdb8B35c { "attribute_name": attribute_value }

Example response:

HTTP/1.1 200 OK Content-Type: application/json { "id": 1, "attribute_name": attribute_value }

Deleting a Resource

Example request:

DELETE /2.0/resource/{resource_id} HTTP/1.1 Host: api.classy.org Authorization: Bearer a2eccdb8B35c

Example response:

HTTP/1.1 200 OK