Get: Location
The Get Location API provides information about different locations, including warehouses and offices. This API allows you to retrieve details such as the address, contact information, and geolocation coordinates for each location. Below is the documentation for the Get Location API.
Endpoint
GET /{{BaseURL}}/Location
Request Parameters
The Get Location API does not require any specific request parameters.
Response
The API response will be a JSON array containing objects representing different locations. Each location object will have the following properties:
- `id` (string): Unique identifier for the location.
- `name` (string): The name associated with the location.
- `isTest` (boolean): Indicates whether the location is a test location.
- `type` (string): The type of the location (e.g., "Warehouse").
- `address` (object): An object containing detailed address information.
Address Object Properties
- `name` (string): The name associated with the address.
- `company` (string, optional): The company name associated with the address.
- `street1` (string): The primary street address line 1.
- `street2` (string, optional): Additional street address line 2.
- `street3` (string, optional): Additional street address line 3.
- `city` (string): The city name.
- `countryCode` (string): The country code (e.g., "IN" for India).
- `phone` (string, optional): The contact phone number for the location.
- `zip` (string): The postal/ZIP code.
- `email` (string, optional): The contact email address for the location.
- `isResidential` (boolean): Indicates whether the address is a residential location.
- `latitude` (float): The latitude coordinate of the location.
- `longitude` (float): The longitude coordinate of the location.
- `stateCode` (string): The state code or abbreviation.
- `verify` (boolean): Indicates whether the address needs verification.
- `verificationStatus` (string): The verification status of the address (e.g., "Success").
Example Response
[ { "id": "64d4a71ddd00000366261d1f", "name": "Primary", "isTest": true, "type": "Warehouse", "address": { "name": "Primary", "street1": "Regus, 5th Floor, Tower C, Green Boulevard, B-Block, Sector 62", "street2": "", "street3": "", "city": "Noida", "countryCode": "IN", "phone": "9773769486", "zip": "201309", "isResidential": false, "latitude": 28.6197608, "longitude": 77.3704878, "stateCode": "UP", "verify": false, "verificationStatus": "Success" } }, // Additional location objects... ]
Additional Note
- The latitude and longitude values provided in the response are coordinates for the locations and can be used for mapping or geo-location purposes.
Get: Location by ID
The Get Location by ID API allows you to retrieve location information based on a unique identifier (ID). This API provides detailed information about a specific location, including its name, type, address, and contact details.
API Endpoint
GET /{{BaseURL}}/Location/{location_id}
Request Parameters
- `location_id` (string, required): The unique identifier of the location you want to retrieve information for.
Please replace `{location_id}` with the actual ID of the location you want to retrieve information for. Ensure that you have proper authentication credentials to access this API.
Response Format
The API response will be in JSON format and will include the following fields:
- `id` (string): The unique identifier of the location.
- `name` (string): The name of the location.
- `isTest` (boolean): Indicates whether the location is a test location.
- `type` (string): The type of the location (e.g., Warehouse, Office, Store).
- `address` (object): An object containing the address details of the location.
- `name` (string): The name associated with the address (e.g., recipient's name).
- `company` (string): The company name associated with the address.
- `street1` (string): The first line of the street address.
- `street2` (string): The second line of the street address.
- `street3` (string): The third line of the street address.
- `city` (string): The city where the location is situated.
- `countryCode` (string): The ISO 3166-1 alpha-2 country code (e.g., "IN" for India).
- `phone` (string): The contact phone number associated with the location.
- `zip` (string): The postal code of the location.
- `email` (string): The email address associated with the location.
- `isResidential` (boolean): Indicates whether the address is a residential address.
- `latitude` (float): The latitude coordinate of the location.
- `longitude` (float): The longitude coordinate of the location.
- `stateCode` (string): The ISO 3166-2 state/province code (e.g., "UP" for Uttar Pradesh).
- `verify` (boolean): Indicates whether the address needs verification.
- `verificationStatus` (string): The verification status of the address (e.g., "Success", "Pending").
Example Request
GET /{{BaseURL}}/Location/647da3c9d40010c2318c59a9
Example Response
{ "id": "647da3c9d40010c2318c59a9", "name": "ImpledgeDemo", "isTest": true, "type": "Warehouse", "address": { "name": "Yash Sharma", "company": "Impledge Technologies", "street1": "Regus, 5th Floor, Tower C, Green Boulevard, B-Block, Sector 62", "street2": "", "street3": "", "city": "Noida", "countryCode": "IN", "phone": "9876543210", "zip": "201309", "email": "yash@mailinator.com", "isResidential": false, "latitude": 0.0, "longitude": 0.0, "stateCode": "UP", "verify": false, "verificationStatus": "Success" } }
POST: Create Location
The Post Create Location API allows you to create and post address information to our system. This API is designed to handle address details for various types of locations, such as offices, warehouses, and more. This document provides comprehensive information about the request structure, response format, and endpoint details for using the Post Address API.
Endpoint:
POST /{{BaseURL}}/Location
Request
The request body should contain a JSON object with the address information to be posted. Here is an example of the request body:
{ "id": "64dca2eb822cae68cb08eb06", "name": "Impledge Office Noida 2", "isTest": false, "type": "Warehouse", "address": { "name": "Yash Sharma", "company": "Impledge Technologies", "street1": "Regus, 5th Floor, Tower C, Green Boulevard, B-Block, Sector 62", "street2": "", "street3": "", "city": "Noida", "countryCode": "IN", "phone": "9876543210", "zip": "201309", "email": "yash@mailinator.com", "isResidential": false, "latitude": 0.0, "longitude": 0.0, "stateCode": "UP", "verify": true, "verificationStatus": "Success" } }
Response
Upon successful creation of the address, the API will respond with a status code `201 Created` and a JSON object representing the created address. Here is an example of a response:
{ "status": "success", "message": "Address created successfully", "data": { "id": "64dca2eb822cae68cb08eb06", "name": "Impledge Office Noida 2", "isTest": false, "type": "Warehouse", "address": { "name": "Yash Sharma", "company": "Impledge Technologies", "street1": "Regus, 5th Floor, Tower C, Green Boulevard, B-Block, Sector 62", "street2": "", "street3": "", "city": "Noida", "countryCode": "IN", "phone": "9876543210", "zip": "201309", "email": "yash@mailinator.com", "isResidential": false, "latitude": 0.0, "longitude": 0.0, "stateCode": "UP", "verify": true, "verificationStatus": "Success" } } }
PUT: Update Location
Updates the details of the location based on the provided location ID.
DELETE: Delete Location
The Delete Location API allows you to delete a specific address location using its unique `location_id`.
Endpoint:
DELETE /{{BaseURL}}/Location/{location_id}
Parameters
- `location_id` (path parameter) - The unique identifier of the location to be deleted.
Request
Example
Request
```http
DELETE /Location/123456
```
Response
The response from the Delete Location API includes status codes 200 success status code, which signify the request was successful and the server has responded with the requested information. The response will contain either a "true" or "false" value.
Rate Limiting
The Delete location API does not enforce rate limiting.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article