HomeGuidesRecipesAPI Reference
Log In
API Reference

API Basics

Information API basics and the various components such as HTTP methods, status codes, data types and parameter types.

REST APIs?

REST (Representational State Transfer) is an architectural style for designing networked applications. It is based on a set of principles and constraints to build APIs (Application Programming Interfaces) that enable communication between different systems over the Internet. REST APIs expose the functionalities of a service or application, allowing developers to interact with it programmatically.

A RESTful web application provides information about itself through its resources. Also, it allows the client to act on those resources, such as adding new resources (for example, adding a new user) or changing existing resources (for example, editing a post).

Example

Use the Falcon add users API to add a new user. The API response returns a unique identifier of the newly added user. The representation of the state is in a JSON format.

POST/user
-X POST https://creditqa.tab.kitecash.in/cc-open-api/falcon/v2/user
-H 'Authorization: {{access_token}} \
-H 'accept: application/json' \
-H 'content-type: application/json' \
-d '{
    "cifNumber": "43804110342",
    "personalDetails": {
        "salutation": "MR",
        "userFirstName": "Hello",
        "userMiddleName": "User",
        "userLastName": "New",
        "userPAN": "ABYPP5886J",
        "userMobileNumber": "9702169003",
        "email": "[email protected]",
        "userDOB": "1989-11-04",
        "userGender": "MALE",
        "fatherName": "Jona",
        "motherName": "Luc",
        "userOVDType": "AADHAR",
        "userOVDID": "4312"
    },
    "permanentAddress": {
        "houseNumber": "10",
        "address": "permanent addres",
        "locality": "permanent locality",
        "city": "Gurgaon",
        "state": "Haryana",
        "pinCode": "122001",
        "country": "INDIA"
    },
    "deliveryAddress": {
        "houseNumber": "11",
        "address": "delivery addres",
        "locality": "delivery locality",
        "city": "New Delhi",
        "state": "Tamil Nadu",
        "pinCode": "122001",
        "country": "INDIA"
    },
    "officeAddress": {
        "houseNumber": "12",
        "address": "office addres",
        "locality": "office locality",
        "city": "Gurgaon",
        "state": "Haryana",
        "pinCode": "122002",
        "country": "INDIA"
    }
}'
{
    "userId": "c84832dc-60f3-4682-9e44-79f0f01eae2d"
}

The following information defines the communication between client and server during API polling:

  • An identifier of the resource: This is the resource URL, also called an endpoint.
  • The operation you want to perform on the resource (in the form of an HTTP method or verb): GET, POST, PUT, PATCH, and DELETE.

HTTP Methods

HTTP defines a set of request methods. These methods indicate actions for a given resource.

Given below is the list of methods commonly used in Falcon APIs.

MethodDescription
GETSubmits a request to retrieve any required information about a resource.
POSTSubmits a request to add new records to a database.
PUTSubmits a request to update or replace an existing resource on the server.
DELETESubmits a request to delete a particular resource.
PATCHSubmits a request to modify a resource.

Parameter

Parameters are options that contain data. You can pass these with an endpoint to get a required response. The table below depicts the various parameters.

Parameter TypeDescription
Path ParametersPath parameters are a part of the URL in a REST API endpoint. These parameters are used to identify a specific resource.
Query ParametersQuery parameters are key-value pairs added to the end of a URL. These parameters act as sorting options or configurations for the request. They are part of the query string and appear after a ? in the endpoint.
Request ParametersRequest parameters are added in the request body. These parameters contain data sent to a server via the REST API.
Response ParametersResponse parameters are the data fields included in the server's response to an API request. They provide the client (e.g., an app, website, or system) with the information it requested or details about the status of the request.

HTTPS Status Codes

HTTP response status codes represent whether a request is completed. All responses are grouped into the following classes.

  • Informational responses (100–199)
  • Successful responses (200–299)
  • Redirection messages (300–399)
  • Client error responses (400–499)
  • Server error responses (500–599)

Success Codes

Below is the success status code used in the Falcon APIs.

Status CodesDescription
200Success
201The request was successful, and a new resource was created. This is usually a response sent after POST requests.

Error Codes

Given below is the list of error status codes used in the Falcon APIs.

Status CodesDescription
400 Bad RequestThe server cannot or will not process the request due to something that is perceived to be a client error.
401 UnauthorizedAlthough the HTTP standard specifies unauthorised, semantically, this response means unauthenticated. That is, the client must authenticate itself to get the requested response.
404 Not FoundThe server can not find the requested resource. In the browser, this means the URL is not recognised. In an API, this can also mean that the endpoint is valid, but the resource itself does not exist. Servers may also send this response instead of 403 Forbidden to hide the existence of a resource from an unauthorised client. This response code is probably the most well-known due to its frequent occurrence on the web.
429 Throttling ErrorThe server is processing too many requests at once and is unable to process your request. Retry the request after some time.
500 Internal Server ErrorThe server has encountered a situation it does not know how to handle.
502 Bad GatewayThis error response means that the server received an invalid response while working as a gateway to get the response needed to handle the request.
503 Service UnavailableThe server is not ready to handle the request. Common causes are a server that is down for maintenance or is overloaded.