# Channel Setup Services

All services related to ChannelSetup are listed in this page.

### `POST` Execute Channel Setup

This method is used to execute ChannelSetup.

**Path:** `/api/v1/oms/setup/channels/execute/`

**Query Parameters**

The following query parameters can be used for the task about ChannelSetup execute.

| Parameter | Data Type | In     | Description                         |
| --------- | --------- | ------ | ----------------------------------- |
| token     | string    | header | The API key of the customer account |

**Example Request**

To execute ChannelSetup task, a `POST` request should be sent to `/api/v1/oms/setup/channels/execute/` endpoint. No query parameters or request body are required.

Once the ChannelSetup execution task is finished, Omnitron channels will be generated within the OMS. You can verify the presence of these channels by navigating to Akinon OMS > Settings > Sales Channels.

```python
import requests

url = "https://{oms_base_url}/api/v1/oms/setup/channels/execute/"
api_token = "f532eXXXXXXXXXXXXXXXXX201XXXXX9332d"

headers = {
'Accept': 'application/json',
'Authorization': 'Token {}'.format(api_token)
}

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

print(response.json())
```

**Example Response (204)**

A successful response with a status code 204 No Content is returned.

### `GET` Get ChannelSetup Async Status

This method used to get async status of the ChannelSetup.

**Path:** `/api/v1/oms/setup/channels/get_async_status/`

**Query Parameters**

The following query parameters can be used to get the ChannelSetup status.

| Parameter | Data Type | In     | Description                         |
| --------- | --------- | ------ | ----------------------------------- |
| token     | string    | header | The API key of the customer account |

**Example Request**

To get ChannelSetup status, a `GET` request should be sent to `/api/v1/oms/setup/channels/get_async_status/` endpoint. No query parameters or request body are required.

```python
import requests

url = "https://{oms_base_url}/api/v1/oms/setup/channels/get_async_status/"
api_token = "f532eXXXXXXXXXXXXXXXXX201XXXXX9332d"

headers = {
'Accept': 'application/json',
'Authorization': 'Token {}'.format(api_token)
}

response = requests.request("GET", url, headers=headers)

print(response.json())
```

**Example Response (200)**

In a successful response with a status code of 200 OK, the API returns async status information.

| Parameter | Data Type | Description                     |
| --------- | --------- | ------------------------------- |
| result    | String    | The Status of ChannelSetup Task |

This example response serves as a reference to understand the structure and data format of service.

```json
{
    "result": "Finished" // or "Ready", "Working", "Failed","Aborted"
}
```

### `GET` Get ChannelSetup Required Status

This method is used to get required status of the ChannelSetup.

**Path:** `/api/v1/oms/setup/channels/is_required/`

**Query Parameters**

The following query parameters can be used to get information about whether the ChannelSetup is required or not.

Provides the answer to the question "Do I need to run this process?". This service will return "true" if there are any Omnitron channels that are not present in the OMS database.

| Parameter | Data Type | In     | Description                         |
| --------- | --------- | ------ | ----------------------------------- |
| token     | string    | header | The API key of the customer account |

**Example Request**

To get ChannelSetup required status, a `GET` request should be sent to `/api/v1/oms/setup/channels/is_required/` endpoint. No query parameters or request body are required.

```python
import requests

url = "https://{oms_base_url}/api/v1/oms/setup/channels/is_required/"
api_token = "f532eXXXXXXXXXXXXXXXXX201XXXXX9332d"

headers = {
'Accept': 'application/json',
'Authorization': 'Token {}'.format(api_token)
}

response = requests.request("GET", url, headers=headers)

print(response.json())
```

**Example Response (200)**

In a successful response with a status code of 200 OK, the API returns required status information.

| Parameter | Data Type | Description                              |
| --------- | --------- | ---------------------------------------- |
| result    | String    | The required status of ChannelSetup Task |

This example response serves as a reference to understand the structure and data format of the service.

```json
{
    "result": "True" // or False
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://apidocs.akinon.com/oms/channel-setup-services.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
