Request Structure
This topic describes the structure of NovoOne API requests.
Request example
We take the Update Feature Code Setting API as an example to show you how an API request is structured and what each element represents.
PUT /uc-cconfig/api/v1/feature-codes HTTP/1.1 Host: api.cn.novoone.com Authorization: Bearer {access_token} Content-Type: application/json x-tenant-code: {tenant_name} { "recordingEnabled": false, "voicemailLeaveEnabled": true, "transferDigitTimeout": 8, "forwardNoAnswerEnabled": false }
| Element | Description |
|---|---|
PUT |
Specify the request method. For more information, see Request method. |
/uc-cconfig/api/v1/feature-codes |
Specify the API endpoint used to update feature code settings
for a tenant. For more information, see Endpoint. |
| HTTP/1.1 | Specify the HTTP protocol version. |
| Host: api.cn.novoone.com | Specify the NovoOne API domain. For more information, see Base URL. |
Authorization: Bearer
{access_token} |
Specify the access token used to authenticate the request.
For more information, see Authenticate header. |
Content-Type: application/json |
Specify the media type of the request body. For more information, see Content Type header. |
x-tenant-code:
{tenant_name} |
Specify the target tenant for the request. For more information, see Tenant Code header. |
{
"recordingEnabled": false,
"voicemailLeaveEnabled": true,
"transferDigitTimeout": 8,
"forwardNoAnswerEnabled": false
}
|
Specify the data sent to the API server. For more information, see Request body. |
Request method
Request method specifies the operation to perform in an API request. NovoOne API supports the following request methods:
| HTTP Method | Description |
|---|---|
| GET | Query information. |
| POST | Add an object or perform specific operations. |
| PUT | Update configurations. |
| DELETE | Delete one or more objects. |
Request URL
{base_url}/{endpoint}| Element | Description |
|---|---|
{base_url} |
Base URL specifies the domain of the NovoOne API.
Note:
|
{endpoint} |
Endpoint identifies the API endpoint to which the request is
sent.
|
Request header
HTTP request header may include the following fields.
| Field | Description |
|---|---|
| Authenticate |
The Note:
Header Field Format:
Header Field
Example:
|
| Content-Type | For POST and PUT requests, Content-Type
header specifies the media type of the request body.
|
| x-tenant-code | x-tenant-code header specifies the target
tenant when the API request manages tenant resources, such as
emergency contacts, feature codes, and tenant users.Note: You can query the tenant name using
the Query Tenants
interface. Header Field Format
Header Field
Example |
Request body
Content-Type
header field to indicate the data format.NovoOne API supports the following data formats for POST or PUT requests.
| Request | Example |
|---|---|
| Form-encoded requests |
Body Format
Body
Example
|
| JSON requests |
Body Format {
"key1": "value1",
"key2": "value2"
}
Body
Example
{
"username": "admin",
"password": "123456"
} |