import requests
url = "https://api.diga.io/v1/agent/{agent_id}/published_version"
payload = {
"version_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"outbound_phone_number_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"inbound_phone_number_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"published_version_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"outbound_phone_number_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"inbound_phone_number_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}Publish a specific version of an agent and associate it with phone numbers. Phone numbers can be inbound, outbound, or both. If version_id is None, unpublishes the current published version.
import requests
url = "https://api.diga.io/v1/agent/{agent_id}/published_version"
payload = {
"version_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"outbound_phone_number_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"inbound_phone_number_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text){
"agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"published_version_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"outbound_phone_number_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"inbound_phone_number_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
The version id to be published. If not provided, the current version published will be unpublished
The outbound phone number id to be used by the agent for outbound calls.
The inbound phone number id to be used by the agent for inbound calls.
Successful Response
The unique identifier for the agent
The version id that was published. If not provided, the agent was unpublished
The outbound phone number id to be used by the agent for outbound calls.
The inbound phone number id to be used by the agent for inbound calls.