import requests
url = "http://localhost:3000/v1/phone/{phone_id}"
payload = {
"nickname": "<string>",
"inbound_version_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"outbound_version_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){
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_date": "2023-11-07T05:31:56Z",
"number": "<string>",
"inbound_agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"inbound_agent_version_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"outbound_agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"outbound_agent_version_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"nickname": "<string>"
}Change the agent associated with a phone. It requires a valid agent_version_id, that will publish the version of that agent. If a agent has already a published version, it will use that version instead of creating a new one.
import requests
url = "http://localhost:3000/v1/phone/{phone_id}"
payload = {
"nickname": "<string>",
"inbound_version_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"outbound_version_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){
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_date": "2023-11-07T05:31:56Z",
"number": "<string>",
"inbound_agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"inbound_agent_version_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"outbound_agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"outbound_agent_version_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"nickname": "<string>"
}Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
The nickname given to the phone number
The unique identifier for the agent that will receive the call when this phone receives an inbound call
The unique identifier for the agent that will make the calls when using this phone to make outbound calls
Successful Response
Unique identifier for the phone record
The datetime when the phone was created
The phone number
The unique identifier for the agent that will receive the call when this phone receives an inbound call
The unique identifier for the version of the agent that will receive the call when this phone receives an inbound call
The unique identifier for the agent that will make the calls when using this phone to make outbound calls
The unique identifier for the version of the agent that will make the calls when using this phone to make outbound calls
The nickname given to the phone number