List all On-demand Credentials.
Successful response with multiple credentials
Array of objects (On-demand Credential) | |
object (PaginationMeta) |
Bad request
Unauthorized
Resource not found
import telnyx telnyx.api_key = "YOUR_API_KEY" telnyx.TelephonyCredential.list(page={"number":1,"size":20})
{- "data": [
- {
- "created_at": "2020-06-18T21:32:38",
- "expired": "false",
- "expires_at": "2042-06-18T21:32:38",
- "id": "c215ade3-0d39-418e-94be-c5f780760199",
- "name": "2020-06-18 21:32:38.917732Z",
- "record_type": "credential",
- "resource_id": "connection:804252963366242252",
- "sip_password": "a92dbcfb60184a8cb330b0acb2f7617b",
- "sip_username": "gencrednCvHU5IYpSBPPsXI2iQsDX",
- "updated_at": "2020-06-18T21:32:38.000Z",
- "user_id": "user-id"
}
], - "meta": {
- "page_number": 2,
- "page_size": 25,
- "total_pages": 3,
- "total_results": 55
}
}
Create a credential.
Parameters that can be defined during credential creation
Successful response with details about a credential
Bad request
{- "connection_id": "1234567890",
- "name": "My-new-credential"
}
{- "data": {
- "created_at": "2020-06-18T21:32:38",
- "expired": "false",
- "expires_at": "2042-06-18T21:32:38",
- "id": "c215ade3-0d39-418e-94be-c5f780760199",
- "name": "2020-06-18 21:32:38.917732Z",
- "record_type": "credential",
- "resource_id": "connection:804252963366242252",
- "sip_password": "a92dbcfb60184a8cb330b0acb2f7617b",
- "sip_username": "gencrednCvHU5IYpSBPPsXI2iQsDX",
- "updated_at": "2020-06-18T21:32:38.000Z",
- "user_id": "user-id"
}
}
Returns a list of tags used on Credentials
Successful response with multiple tags
Array of objects | |
object (PaginationMeta) |
Bad request
Unauthorized
Resource not found
{- "data": [
- {
- "amount": 1,
- "tag": "a_tag"
}
], - "meta": {
- "page_number": 2,
- "page_size": 25,
- "total_pages": 3,
- "total_results": 55
}
}
Delete an existing credential.
Successful response with details about a credential
object (TelephonyCredential) | |||||||||||||||||||||
|
Unauthorized
Resource not found
Bad request
import telnyx telnyx.api_key = "YOUR_API_KEY" res=telnyx.TelephonyCredential.retrieve("ID") res.delete()
{- "data": {
- "created_at": "2020-06-18T21:32:38",
- "expired": "false",
- "expires_at": "2042-06-18T21:32:38",
- "id": "c215ade3-0d39-418e-94be-c5f780760199",
- "name": "2020-06-18 21:32:38.917732Z",
- "record_type": "credential",
- "resource_id": "connection:804252963366242252",
- "sip_password": "a92dbcfb60184a8cb330b0acb2f7617b",
- "sip_username": "gencrednCvHU5IYpSBPPsXI2iQsDX",
- "updated_at": "2020-06-18T21:32:38.000Z",
- "user_id": "user-id"
}
}
Get the details of an existing On-demand Credential.
Successful response with details about a credential
object (TelephonyCredential) | |||||||||||||||||||||
|
Bad request
Unauthorized
Resource not found
import telnyx telnyx.api_key = "YOUR_API_KEY" telnyx.TelephonyCredential.retrieve("ID")
{- "data": {
- "created_at": "2020-06-18T21:32:38",
- "expired": "false",
- "expires_at": "2042-06-18T21:32:38",
- "id": "c215ade3-0d39-418e-94be-c5f780760199",
- "name": "2020-06-18 21:32:38.917732Z",
- "record_type": "credential",
- "resource_id": "connection:804252963366242252",
- "sip_password": "a92dbcfb60184a8cb330b0acb2f7617b",
- "sip_username": "gencrednCvHU5IYpSBPPsXI2iQsDX",
- "updated_at": "2020-06-18T21:32:38.000Z",
- "user_id": "user-id"
}
}
Update an existing credential.
Parameters that can be updated in a credential
Successful response with details about a credential
object (TelephonyCredential) | |||||||||||||||||||||
|
Unauthorized
Resource not found
Bad request
{- "connection_id": "987654321",
- "name": "My-new-updated-credential"
}
{- "data": {
- "created_at": "2020-06-18T21:32:38",
- "expired": "false",
- "expires_at": "2042-06-18T21:32:38",
- "id": "c215ade3-0d39-418e-94be-c5f780760199",
- "name": "2020-06-18 21:32:38.917732Z",
- "record_type": "credential",
- "resource_id": "connection:804252963366242252",
- "sip_password": "a92dbcfb60184a8cb330b0acb2f7617b",
- "sip_username": "gencrednCvHU5IYpSBPPsXI2iQsDX",
- "updated_at": "2020-06-18T21:32:38.000Z",
- "user_id": "user-id"
}
}
Perform activate or deactivate action on provided Credential. Activate action will change the status to active, making it possible to connect calls with the credential. Deactivate action will change the status to inactive, making it impossible to connect calls with the credential.
Successful response with details about a credential
object (TelephonyCredential) | |||||||||||||||||||||
|
Bad request
Unauthorized
Resource not found
{- "data": {
- "created_at": "2020-06-18T21:32:38",
- "expired": "false",
- "expires_at": "2042-06-18T21:32:38",
- "id": "c215ade3-0d39-418e-94be-c5f780760199",
- "name": "2020-06-18 21:32:38.917732Z",
- "record_type": "credential",
- "resource_id": "connection:804252963366242252",
- "sip_password": "a92dbcfb60184a8cb330b0acb2f7617b",
- "sip_username": "gencrednCvHU5IYpSBPPsXI2iQsDX",
- "updated_at": "2020-06-18T21:32:38.000Z",
- "user_id": "user-id"
}
}