process-locations-api

(0 reviews)

home

Process Locations API:

The process locations api , is used to get TA location details from Riversand MdM.

High-level design:

resources/Capture-0230d01f-d130-4a3a-a36d-8a716143701e.PNG

Resources Available:

  • Location Collection
  • Location Record

Request Url to access the Api:

https://api.accessta.com/location-services/1/locations/{siteId}

##Required Header Parameters:

  • pagination_enabled: "Y" or "N"- will provide a paginated response based on the input value.
  • app_name: Need to specify the requesting app name
  • correlation_id: corelation Id or UUID
  • Authorization:

Introduction

This document provides comprehensive information about the endpoints, request parameters, response payloads, and authentication mechanisms for integrating with Process Locations API.

Description:

The Api gets the list of all the location including the location details, such as: amenities available at the Ta location, details of the full and quick service restaurants available at the location, no. of Gasoline and Diesel pumps available and many more, from Riversand Mdm and maps the information to client specific response.

Sequence diagram

resources/image-e2607365-9343-446f-add1-3614e22a56cc.png

Base URL

The base URL for accessing the API endpoints is: https://api.accessta.com/location-services/1/locations

Authentication

The API requires authentication using JWT Token. A ClientID and Client Secret, are required to send a request to the Token endpoint(below). As a response client would receive a JWT token.

To obtain the ClientID and Client Secret, please contact our Mulesoft Hub team.

Token Endpoint

https://login.accessta.com/oauth/token

Headers:

Content-Type: application/json

Request body:

{ "client_id": "<>",

"client_secret": "<>",

"audience": "https://api.accessta.com",

"grant_type": "client_credentials" }

Curl:

curl --location 'https://login.accessta.com/oauth/token' \

--header 'Content-Type: application/json' \

--data'{

"client_id": "<>",

"client_secret": "<>",

"audience": "https://api.accessta.com",

"grant_type": "client_credentials" }'

Sample Response:

{"access_token": "eyJhbGljhJVj_WR0b2Ei3Bj7L25oGfhJhhyjsa2OQpUrWSdJ6hl7_vwARi58wQ",

"scope": "location-services:locations:read",

"expires_in": 86400,

"token_type": "Bearer"}

Process Locations Api Endpoints

1. Endpoint 1

Description

This endpoint provides details of all the Ta sites.

Request

  • Method: GET

Ā· URL: https://api.accessta.com/location-services/1/locations?limit=10&page_nbr=1

  • Headers(required):
    • Authorization: Bearer {token} received from the Token endpoint
    • app_name : Name of the app requesting data
    • correlation_id: used for tracking the request sent
    • pagination_enabled: accepts ā€˜Y or Nā€™. If the value is set to ā€œYā€, then paginated response is sent based on the limit and page_nbr provided in the request parameters.If set to ā€œNā€, complete response(all sites) are sent in response without pagination.
  • Query Parameters(optional):
    • Limit : the maximum number of sites to return in a single request(e.g.: 1000,10..). Default set to 2000 if not specified.
    • page_nbr: used to specify the page number

Ā· Request Curl:

curl --location 'https://api.accessta.com/location-services/1/locations?limit=10&page_nbr=1' \

--header 'app_name: Postman' \

--header 'correlation_id: {{guid}}' \

--header 'Content-Type: application/json' \

--header 'pagination_enabled: Y' \

--header 'Authorization: Bearer {Token}'

Response

Attached:__\_ getlocations_response.json

2. Endpoint 2

Description

This endpoint provides details of all the specific site.

Request

  • Method: GET

Ā· URL: https://api.accessta.com/location-services/1/locations/0153

  • Headers(required):
    • Authorization: Bearer {token} received from the Token endpoint
    • app_name : Name of the app requesting data
    • correlation_id: used for tracking the request sent
  • URI Parameters(required):
    • {SiteId} : site Id of the site for which details are requested (e.g.: 0001,0022,ā€¦).

Request Curl:

curl --location 'https://api.accessta.com/location-services/1/locations/0153' \

--header 'app_name: Postman' \

--header 'correlation_id: cd8a4945-3e32-4d74-b7b5-3a2d1b7b7d7c' \

--header 'Content-Type: application/json' \

--header 'pagination_enabled: true' \

--header 'Authorization: Bearer {Token}'

Response

Attached__\_ getlocationBySiteId.json

Error Handling

Our API follows standard HTTP status codes for indicating the success or failure of a request. In case of an error, additional details may be provided in the response body.

  • 400 Bad Request: Invalid request parameters.

Ā· 401 Unauthorized:Invalid token..

  • 404 Not Found: Resource not found.
  • 5xx Server Error: Internal server error.

Rate Limiting

To ensure fair usage of our API resources, we enforce rate limiting. Each API key is allowed a maximum number of requests per minute. If the rate limit is exceeded, the client will receive a 429 Too Many Requests response.

Support contact

For any questions or to report any issues found in the API reach out to Hub team at MuleSoftAlerts@ta-petro.com


Reviews