Skip to content
Goran Nikic edited this page Feb 12, 2018 · 5 revisions

The Web API is a new REST based interface to key parts of the Opencinema Server business layer. It is available under the /authenticate URL of Opencinema API web servers.

  1. Authorization
  2. Status Codes
  3. Contact Support

Authorization

Authorization is done using the standard HTTP Authorization header. There are two authorization schemes, both of which use the same format for a set of Opencinema credentials:

username:password

For maximum compatibility with HTTP, authorization should be performed with HTTP Basic authorization , using Base64 encoded Opencinema credentials.

Status codes

2xx - Success responses

Any status code in the range 200 - 299 indicates that the request was successful. The actual status code value will vary according to the specific API being used.

3xx - Redirect responses

301 - Moved Permanently

Resource has permanently moved to a new location. This old location is being maintained for backwards compatibility only and may be removed in the future. Update your code to reflect the new location.

302 - Moved Temporarily

Resource has temporarily been moved to a different location, resubmit your request to the new location.

4xx - Client-side error responses

400 - Bad Request

Something was wrong with your request. Check the Message property of the response for more information about what was wrong. Make sure that your request is valid - check the headers and the content.

401 - Unauthorized

The resource you are trying to access requires authorisation and you have not provided any credentials. Make sure you have provided a valid Authorization header, and that the Username, Password and Account are correct.

403 - Forbidden

The credentials contained in the Authorization header do not permit access to the requested resource.

404 - Not Found

The requested resource could not be found. Make sure the URL is correct, and if it is, make sure that the ID of the resource you are trying to access is also correct. Eg:

/api/call/1234 - This is incorrect because the API URL is /api/calls (not /api/call).

/api/calls/4567 - This might return 404 because Call ID 4567 does not exist.

410 - Gone

The resource you are trying to access has been deprecated and subsequently removed from the API. Update your application to use the latest version of the API.

422 - Unprocessable Entity

The request was correctly structured, but semantically invalid. Eg, trying to submit a Questionnaire with invalid Answers, or attempting to create a User without a Username. Check the response body for more information about what went wrong.

429 - Too Many Requests

The user agent's IP address has made too many requests and is now being throttled. The Retry-After header will indicate how long (in seconds) the agent must wait before new requests will be serviced. Make no more requests from this IP address until then. Eg:

if (response.StatusCode == 429) Thread.Sleep(Int32.Parse(response.Headers["Retry-After"]));

5xx - Server-side error responses

Status codes in the range 500 - 599 indicate that an error occurred on the server while processing the request. Contact support@novnik.com for assistance and be sure to include the full HTTP request you are making, including the full URL, the HTTP verb, the Authorization and Accept headers, and the body content.

Contact Support

If you run into issues, need additional filters or functionality to build you application please contact info@novnik.com. If you run into issues please ensure that you fully document the issue.

Clone this wiki locally