The REST API for POST and PUT feature will be deprecated.
Consider using the Record APIs feature instead.
Overview
ReadiNow allows third party systems to connect to ReadiNow to Create, Update or Delete records of any object within ReadiNow. This is achieved through configurable API endpoints where the Administrator specifies which object to expose to an API.
Definitions:
- API: An application programming interface.Within ReadiNow this is a collection of endpoints that are grouped and secured together in order for third party systems to perform actions on records within ReadiNow
- API Endpoint: An endpoint is a web address that the remote system can use to connect to our system. Each endpoint does either a create, update or delete of a particular record of a nominated object. These Endpoints can be created and configured by the ReadiNow Administrator
- API Key: The authentication mechanism for calling endpoints in an API.
Process:
- Decide which object needs to be exposed to an API
- Create an API (see below)
- Configure the Endpoint which specifies the object and allowed actions (create, update, delete via API)
- Create API key (see below)
- Use the details generated to configure the third party system (or integration tool) to POST, PUT or DELETE (which corresponds to create, update and delete) action to ReadiNow
Creating an API
To create an API:
- Select Application Menu. The menu appears with available applications.
- Select Administration. The application displays at the landing page.
- In the Left Navigation Area, select Integration. The Integration expands to display list.
- Select APIs. The existing APIs display.
- Select +NEW. The API form displays.
- Type the Name in the Name field
- Type the Address in the Address field, e.g. the name of application in one word. Please refer to step 4 of creating endpoint.
- Select the checkbox for Enabled.
- Select Save to save the details.
Creating an Endpoint for any object
To create an Endpoint for any object:
- On the Endpoints tab of the newly created API, select +NEW. The menu appears.
- Select API Resource Endpoint. The API Resource Endpoint form displays.
- In the Object field, select the Pencil icon and select from the list e.g. Student.
- Type the Address in the Address field, e.g. the name of the object in one word. (https://yourseveraddress/spapi/api/yourtenant/yourapiaddress/yourendpoint)
- Select the checkbox for Enabled.
- Select fields as required.
- Select Save to save the details.
Creating an API Key
To create an API Key:
- Select Application Menu. The menu appears with available applications.
- Select Administration. The application displays at the landing page.
- In the Left Navigation Area, select Integration. The Integration expands to display list.
- Select API Keys. The existing API Keys display.
- Select +NEW. The API Key form displays.
- In the API Key field, enter a guid. E.g. b9c91534-7cc1-4e09-b22f-2808072e333e, or generate one at https://www.guidgenerator.com/.
- Select the checkbox for Enabled, if not ticked.
- For Run as user, select a user account such as Administrator (The user account must have access control permission to do whatever you expect the API to do).
- Under APIs Granted tab, link to the New API (or other API as required).
- Select Save to save the details.
Using a tool that can simulate making web requests
To get a tool that can simulate making web requests:
- Use a tool that can simulate making web requests e.g. the Postman Plugin for Chrome.
- Alternatively, see getpostman.com , or just navigate in the Chrome app store.
Running a request to create a new data record
To run a request to create a new account:
- Use Postman to issue a request like this: (see image below).
- Use the 'POST' verb.
- Use key that is generated (e.g. https://yourseveraddress/spapi/api/yourtenant/yourapiaddress/yourendpoint?key=b9c91534-7cc1-4e09-b22f-2808072e333e).
- Select the Body tab.
- Select 'Raw'. The textbox appears.
- Enter this (case sensitive) query:
{ "field1 of string type":"value of field1", "field2 of decimal type":234.0 }
- Set the type to JSON (application/json).
- Select Send.
Notes
- A 201 Created response appears.
- Navigate to your report of your object, a new data record with specified field values is created.
Response Codes
When an API call is made, the server will response with a HTTP response code as follows:
HTTP Response Codes
HTTP Response Code | Meaning |
---|---|
200/201 - OK | (200 or 201 as applicable). Everything worked. |
400 - Bad Request | Something about the request received from the client was invalid.
|
401 - Unauthorized | Any of the following:
|
403 - Forbidden | Any of the following:
|
405 - Method not allowed | Caller attempted to use a verb that was not supported or allowed or enabled by that endpoint. |
500 - Server-side Error | Either of the following:
Ideally all 500 errors will also include an Exxxx error number in their message. See table below. |
Error Codes
In addition to the standard HTTP response codes, the body of the responsee message may contain an error code. Note that error codes do not form part of the HTTP standard.
Errors in the range E0xxx represent platform errors. Errors in the range E1xxx represent request errors. Errors in the range E2xxx represent tenant configuration errors.
Error Code | Message | |
---|---|---|
E0001 | Platform internal error. | |
E1001 | Property ''name'' was formatted incorrectly. | |
E1002 | No resource of the correct type matched the GUID 'guid'. | |
E1003 | No resources were found that matched 'value'. | |
E1004 | Multiple resources were found that matched 'value'. | |
E1005 | Identifier list contained nulls. | |
E1006 | Expected an array of identities for 'property'. | |
E1007 | Cardinality violation. | |
E1008 | Field validation rules were not met. | |
E1009 | The message body was empty. | |
E1010 | Mandatory property 'property' was not provided. | |
E2001 | Multiple API keys have the same value. | |
E2002 | Multiple APIs matching ''name''. | |
E2003 | Multiple APIs endpoint matching ''name''. | |
E2004 | Endpoint has no resource mapping. | |
E2005 | Resource mapping has no resource type. | |
E2006 | Resource mapping identity field cannot be write-only. | |
E2007 | Resource mapping identity field was not set. | |
E2008 | Field mapping ''name'' did not point to a field. | |
E2009 | Relationship mapping ''name'' did not point to a relationship. | |
E2010 | Field mapping ''name'' did not have a mapped name. |