REST Overview

Every resource in the Backlot API has its own URL. You can view, modify and delete those resources by sending requests to the resource's URL and using standard HTTP methods in your requests.

You can use any HTTP library or tool when making requests. The Backlot API supports the following HTTP methods, each having the conventionalized functions described below.

  • GET: view a resource
  • POST: create a new resource
  • DELETE: delete a resource
  • PUT: replace an existing resource; create a resource
  • PATCH: update or modify an existing resource
Note:

All requests must be made using HTTPS.

Not all routes support all of the requests stated above.

In general, a POST request accepts the same parameters as a PATCH to that resource.

When creating a new resource, you use a POST request. Depending on the requirements of the resource, you configure its settings by including a JSON representation of an object in the body of the request. The following example creates a label, only specifying its name:

[POST]/v2/labels{  
   "name":"Leisure"
}

Although you only configured the name, Backlot automatically configures the remaining settings using the defaults.

If the request is successful, the Backlot API returns a response similar to the following:

{  
   "name":"Leisure",
   "id":"9d765ce4b3884f8",
   "full_name":"/Leisure",
   "parent_id":null
}

You can get this information at any time by issuing a GET request. For example, the following request returns the settings for the label with the 9d765ce4b3884f8 ID.

[GET]/v2/labels/9d765ce4b3884f8

With this information, you can modify the resource using a PATCH request. For example, the following request changes the name of the label to Recreation:

[PATCH]/v2/labels/9d765ce4b3884f8{  
   "name":"Recreation"
}

If the request is successful, the Backlot API returns a response similar to the following:

{  
   "name":"Recreation",
   "id":"9d765ce4b3884f8",
   "full_name":"/Recreation",
   "parent_id":null
}

해당 내용이 도움 되었습니까?