Skip to main content

Address Setup Services

All services related to address setup are listed in this page.

POST Execute

This endpoint is used for adding countries, cities, townships, and districts that exist in Omnitron but are not currently present in the OMS database.

Path: /api/v1/oms/setup/addresses/execute/

Request Body

The following query parameters can be used to execute the setup.

ParameterData TypeInDescription
tokenstringheaderThe API key of the customer account

Example Request

To execute this setup step, a POST request should be sent to the /api/v1/oms/setup/addresses/execute/ endpoint. In the headers, set the Authorization header to include the token for authentication.

Here's an example of how to make the request in python:

import requests

url = "https://{domain_url}/api/v1/oms/setup/addresses/execute/"
token = "f532eXXXXXXXXXXXXXXXXX201XXXXX9332d"

headers = {
'Content-Type': 'application/json',
'Authorization': f'Token {token}'
}

response = requests.request('POST', url, headers=headers)

print(response.status_code)

Response 204 No Content

There is No Response.

GET Get Async Status

This endpoint provides the status of the task executed by the "execute" endpoint. If there is no active task, the result will be returned as "READY."

Path: /api/v1/oms/setup/addresses/get_async_status/

Request Body

The following query parameters can be used to view the status of the setup task.

ParameterData TypeInDescription
tokenstringheaderThe API key of the customer account

Example Request

To view the status of the task, a GET request should be sent to the /api/v1/oms/setup/addresses/get_async_status/ endpoint. In the headers, set the Authorization header to include the token for authentication.

Here's an example of how to make the request in python:

import requests

url = "https://{domain_url}/api/v1/oms/setup/addresses/get_async_status/"
token = "f532eXXXXXXXXXXXXXXXXX201XXXXX9332d"

headers = {
'Content-Type': 'application/json',
'Authorization': f'Token {token}'
}

response = requests.request('POST', url, headers=headers)

print(response.json())

Response 200 OK

Possible values of result are:

  • READY
  • WORKING
  • FINISHED
  • FAILED
  • ABORTED
ParameterData TypeDescription
reusltstringThe status of the task

This example response serves as a reference to understand the structure and data format returned from this API service.

{
"result": "Ready"
}

GET Is Required

This endpoint indicates whether the "execute" endpoint should be called or not. It returns "true" if there are any countries, cities, townships, or districts in Omnitron that are not present in OMS.

Path: /api/v1/oms/setup/addresses/is_required/

Request Body

The following query parameters can be used to execute the setup.

ParameterData TypeInDescription
tokenstringheaderThe API key of the customer account

Example Request

To execute this setup step, a POST request should be sent to the /api/v1/oms/setup/addresses/is_required/ endpoint. In the headers, set the Authorization header to include the token for authentication.

Here's an example of how to make the request in python:

import requests

url = "https://{domain_url}/api/v1/oms/setup/addresses/is_required/"
token = "f532eXXXXXXXXXXXXXXXXX201XXXXX9332d"

headers = {
'Content-Type': 'application/json',
'Authorization': f'Token {token}'
}

response = requests.request('POST', url, headers=headers)

print(response.status_code)

Response 200 OK

Possible values of result are true and false.

ParameterData TypeDescription
resultstringWhether the task should be run or not

This example response serves as a reference to understand the structure and data format returned from this API service.

{
"result": "true"
}