Frequently Asked Questions (FAQs)

What options can I use to invoke cURL?

This table summarizes the cURL options used in the command examples. For example, here's how a code line would look like in cURL:

curl -i -X GET -u <username>:<password> -H <request-header>:<value> https://<subdomain>.<domain>.com/<path>/<resource-path>
cURL Option Description
-d, --data @file.json Identifies the file that contains the request body, in JSON format, on the local machine. Alternatively, you can pass the request body with -d"{id=5,status='OK'}.
-F, --form @file.json Identifies form data, in JSON format, on the local machine.
-H --header, -I -include, and -X --request <method>

Defines content type of the request document.

-i Displays response header information.
-X Indicates the type of request (for example, GET, POST).

What are some examples of API requests for Safety One Intake?

After you set up your REST client, you can send a request to ensure that your connection works. For example, suppose you want to get a recipe by its version. You can use the following request:
{"type":"object","properties":{"recipeId":{"type":"string","description":"Unique
          ID for
          recipe","format":"uuid"},"version":{"type":"number","description":"Recipe
          version","example":2}},"description": "Request object for recipe"}
If the request is successful, then you should receive a 200 response with a body such as the following:
{"type":"object","properties":{"id":{"type":"string","format":"uuid"},
"name":{"type":"string"},"version":{"type":"number"},
"description":{"type":"string"},"docProcessInfo":{"$ref":"#/components/schemas/DocProcessInfo"},
"intakeConfig":{"$ref":"#/components/schemas/IntakeConfig"},
"classificationInfo":{"$ref":"#/components/schemas/ClassificationInfo"}
}
}

Do I have to request a token every time I need to make an API call?

No, you don't have to request a new token every time you make an API call. However, do keep in mind that a token is valid for 5 minutes. If you plan on making numerous API calls throughout the day, you'll have to generate a new token every 5 minutes.

How do I construct my URL for sending requests?

Use the following guidelines when sending requests using the Oracle Safety One Intake REST API.

URL Structure

Access the Safety One Intake REST resources using the following URL structure:
https://<subdomain>.<domain>.com/<resource-path>
Where:
  • <subdomain>.<domain>.com is the host where the Oracle Safety One Intake APIs are running.
  • <resource-path> is the relative path that defines the resource. For a complete list of resources and the paths for each, see All REST Endpoints.

Supported Methods

You can perform basic CRUD operations (create, read, update, and delete) on Oracle Safety One Intake APIs using the standard HTTP method requests GET, PUT, POST, and DELETE.

Media Types

The Safety One Intake REST APIs currently support the following media types:
  • application/JSON
  • application/PDF
  • text/plain
  • multipart/form-data

Supported Headers

Oracle Safety One Intake REST APIs support only the Content-Type header to be passed in the header section of the HTTP request or response. The value for this header is specific to each API endpoint.

Compression

Use of compression on the Oracle Safety One Intake REST APIs resource request and response is not supported at this time.

What are the status codes for an API call?

When you call any of the Oracle Safety One Intake REST resources, the Response header returns one of the standard HTTP status codes defined in the following table:

HTTP Status Code Description
200 OK The request was completed successfully A 200 status is returned for a successful GET or POST method.
201 Created The request was fulfilled and resulted in a new resource being created. The response includes a Location header which contains the canonical URI for the newly created resource. A 201 status is returned from a synchronous resource creation or an asynchronous resource creation that completed before the response was returned.
400 Bad Request The request could not be processed because it contains missing or invalid information (such as a validation error on a parameter or a missing required value).
401 Unauthorized The request is not authorized. The authentication credentials included with this request are missing or invalid.
403 Forbidden The user can't be authenticated. The user does not have authorization to perform this request.
404 Not Found The request includes a resource URI that does not exist.
405 Method Not Allowed The HTTP verb specified in the request (DELETE, GET, POST, PUT) is not supported for this request URL.
406 Not Acceptable The resource identified by this request is not capable of generating a representation corresponding to one of the media types in the Accept header of the request. For example, the request's Accept header is set to XML but the operation only returns JSON.
415 Unsupported Media Type The client's Content-Type header is not correct (for example, the client attempts to send the request in XML, but the resource can only accept JSON).
500 Internal Server Error The server encountered an unexpected condition that prevented it from fulfilling the request.
503 Service Unavailable The server is unable to handle the request due to temporary overloading or maintenance of the server. The <ProductName> REST service is not currently running.