Create APIs
4 min read
You can use any URL endpoint that you define as a HTTP REST endpoint. API enforces HTTPS (TLS) i.e. encrypt your data end to end for maximum safety.
API Gateway supports GET
, POST
, PUT
and DELETE
HTTP request methods
Authentication
Token based API authentications are supported for the time being. Token is used in the Authorization
header for App/Device backends where HTTP headers can be specified. Otherwise, token can be used with URL query parameters. However, latter method is not encouraged, unless your app is frontend only i.e. static webapp.
All requests must be submitted using HTTPS
to avoid compromising your token.
Authorization
If your App/Device has a separate backend, it is highly recommended to whitelist your Domain or IP address
of your servers.
Auth header
When using HTTP REST API without the SDK, for HTTP Basic authentication, you need to use username
and password
separated by a single colon (":") character within a base64 encoded string in the credentials. Here you must leave the username blank
and specify the token
as password
field of the HTTP Basic Auth header.
In plain HTTP, that is
Authorization: Basic Base64 encoded :YOUR_TOKEN
Coming Soon
OAuth authentication & authorization is coming soon.Success Status
Status Code / Text | Description |
---|---|
200 OK | Successful Request |
201 Created | Successful Request & resource is created |
202 Accepted | Request is accepted for processing |
204 No Content | Delete/Update operation successful & no content |
Error Conditions
Status Code / Text | Description |
---|---|
400 Bad Request | If the request has invalid data or parameters |
401 Unauthorized | Either your Auth token is invalid or expired. |
403 Forbidden | Requested endpoint is invalid or method not allowed |
404 Not Found | Request entity/data is not found |
412 Precondition Failed | |
413 Payload Too Large | If the request has large payload than the allowed limit. |
415 Unsupported Media Type | If the media type of the request is not application/json |
429 Too Many Requests | Rate limit exceeded |
500 Internal Server Error | Server side failure, either due to your |
503 Service Unavailable | Service is unavailable due to an unavoidable reason |
520 Unknown Error | If unknown error has occurred |
Query Parameters
Your API can have query parameters
HTTP REST Endpoints
URI Base
All REST API need to prefixed with the following URI base path: /api/v1/agw
and the Endpoint URI
always starts with https://cs.rapidomize.com/api/v1/agw
and based on your
https://cs.rapidomize.com/api/v1/agw/{icappId}
e.g. if your ICApp ID is cfba0c2c-5f61-4866-a3ed-4c2e56f745e7
then the Endpoint URI starts with:
https://cs.rapidomize.com/api/v1/agw/cfba0c2c-5f61-4866-a3ed-4c2e56f745e7
OpenAPI 3.0 specification
OpenAPI 3.0 specification for your API can be retrieved from the endpoint:
https://cs.rapidomize.com/api/v1/agw/{icappId}/openapi.json
For the above example
https://cs.rapidomize.com/api/v1/agw/cfba0c2c-5f61-4866-a3ed-4c2e56f745e7/openapi.json
REST API Endpoints
All your REST API Endpoints need to be prefixed with URI Base. For example, if you have defined and API path to retrieve customer’s data based on their IDs and your REST endpoint path pattern is customer/{id}
, then the Customer Endpoint path for the above
https://cs.rapidomize.com/api/v1/agw/cfba0c2c-5f61-4866-a3ed-4c2e56f745e7/customer/{id}
Based on the HTTP REST specification, you could use each HTTP method to build CRUD (create, retrieve, update, delete) API or other operations. Here is a general guideline for each HTTP method:
GET - Retrieve Entities/Data
API allows you to retrieve Entities/Data from a Action(s)
source, for example, database
or spreadsheet
connected in your
- Retrieve a customer by ID:
/customer/{id}
- Retrieve a list of all customers:
/customer
- Retrieve a list of customers with paging enabled by using query params:
/customer?pg=5&psz=10
. Example: parameters specifypg - page 5 & psz - page size 10
POST - Create or Push Entities/Data
API allows you to create new Entities or send Data to a destination Action(s)
connected in your
- Create customer:
/customer
with data:
{
id: '123-xyz'
name: 'Tom Hanks',
addr: '123 Main St., ....',
contact: '123456789'
...
}
PUT - Update Entities/Data
API allows you to update specified entities or send updated Data to a destination Action(s)
connected in your
- Update customer with ID:
/customer/{id}
{
name: 'Tom Hanks',
addr: '...',
contact: '9999999999'
...
}
DELETE - Delete Entities/Data
API allows you to delete Entities or send delete request to a destination Action(s)
connected in your
- Delete customer with ID:
/customer/{id}
Coming Soon
HTTP request methods other than above such as PATCH, HEAD and OPTION will be available soon.Client SDK
You can access the REST API directly or use the sdk for convenience. We’ve developed API clients for Java, JavaScript, Node.js, Python and C/C++ that will allow you to quickly and easily interact with the API. Depending on your chosen application language, you can find a client SDK at GitHub. The client SDKs are advanced wrappers on top of the REST API.
Language | SDK |
---|---|
Java | Java SDK |
Javascript | Javascript SDK |
Node.js | Node.js SDK |
Python | Python SDK |
C/C++ | C/C++ SDK |
Ruby | Ruby SDK |