Answer rules and forwarding
Answer rules decide what happens when a user's extension rings: ring these devices, forward to a cell, go to voicemail, and so on. Each rule is tied to a time frame, and the first rule whose time frame matches is used.
In the Key Admin this is the Answer rules and forwarding switch. Read lets a key call the GET endpoints below. Write lets it call the ones that change data.
List answer rules for a user
/domains/~/users/{user}/answerrulesReturns the answer rules for one user.
Read Key Admin switch: Answer rules and forwarding, Read. Read only keys also work.
Parameters
| Name | In | Type | Notes |
|---|---|---|---|
user required | path | string | The user ID, usually their extension number, like 1001. Default ~ Min length 0 Max length 16 |
Example request
curl -X GET "https://api.noodlevoice.com/ns-api/v2/domains/~/users/1001/answerrules" \
-H "Authorization: Bearer $NOODLEVOICE_KEY"const res = await fetch("https://api.noodlevoice.com/ns-api/v2/domains/~/users/1001/answerrules", {
method: "GET",
headers: {
Authorization: "Bearer " + process.env.NOODLEVOICE_KEY,
},
});
const data = await res.json();import os, requests
r = requests.get(
"https://api.noodlevoice.com/ns-api/v2/domains/~/users/1001/answerrules",
headers={"Authorization": "Bearer " + os.environ["NOODLEVOICE_KEY"]},
)
print(r.status_code, r.json())Response 200
[
{
"domain": "string",
"user": "1001",
"time-frame": "string",
"enabled": "yes",
"is-active": true,
"order": 99,
"simultaneous-ring": {
"enabled": "yes"
},
"do-not-disturb": {
"enabled": "yes"
},
"...": "12 more fields"
}
]Response fields (49)
| Field | Type | Notes |
|---|---|---|
domain | string | The account the item belongs to. Max length 64 |
user | string | The user ID (extension). |
time-frame | string | |
enabled | string | Whether it is turned on (yes or no). One of: yes, no Default yes |
is-active | boolean | |
order | integer | Order of the item. Default 99 Min 0 |
simultaneous-ring | object | |
simultaneous-ring.enabled | string | Whether it is turned on (yes or no). One of: yes, no Default no |
simultaneous-ring.parameters | array of any | |
do-not-disturb | object | |
do-not-disturb.enabled | string | Whether it is turned on (yes or no). One of: yes, no Default no |
forward-always | object | |
forward-always.enabled | string | Whether it is turned on (yes or no). One of: yes, no Default no |
forward-always.parameters | array of any | |
forward-on-active | object | |
forward-on-active.enabled | string | Whether it is turned on (yes or no). One of: yes, no Default no |
forward-on-active.parameters | array of any | |
forward-on-busy | object | |
forward-on-busy.enabled | string | Whether it is turned on (yes or no). One of: yes, no Default no |
forward-on-busy.parameters | array of any | |
forward-no-answer | object | |
forward-no-answer.enabled | string | Whether it is turned on (yes or no). One of: yes, no Default no |
forward-no-answer.parameters | array of any | |
forward-when-unregistered | object | |
forward-when-unregistered.enabled | string | Whether it is turned on (yes or no). One of: yes, no Default no |
forward-when-unregistered.parameters | array of any | |
forward-on-dnd | object | |
forward-on-dnd.enabled | string | Whether it is turned on (yes or no). One of: yes, no Default no |
forward-on-dnd.parameters | array of any | |
forward-on-spam-call | object | |
forward-on-spam-call.enabled | string | Whether it is turned on (yes or no). One of: yes, no Default no |
forward-on-spam-call.parameters | array of any | |
call-screening | object | |
call-screening.enabled | string | Whether it is turned on (yes or no). One of: yes, no Default no |
phone-numbers-to-allow | object | |
phone-numbers-to-allow.enabled | string | Whether it is turned on (yes or no). One of: yes, no Default no |
phone-numbers-to-allow.parameters | array of any | |
new-position | string | One of: top, bottom |
phone-numbers-to-reject | object | |
phone-numbers-to-reject.enabled | string | Whether it is turned on (yes or no). One of: yes, no Default no |
phone-numbers-to-reject.parameters | array of any | |
time_range_data | array of object | |
time_range_data[].ordinal-order | integer | |
time_range_data[].start-date | string (date) | Start (date). |
time_range_data[].end-date | string (date) | End (date). |
time_range_data[].day-of-week-number | any | Day of week number. |
time_range_data[].start-time | string (time) | Default 00:00 |
time_range_data[].end-time | string (time) | Default 23:59 |
time_range_data[].invert-match | string | One of: yes, no Default no |
Other responses: 400, 401, 404. See errors.
Count answer rules for a user
/domains/~/users/{user}/answerrules/countReturns how many answer rules there are for one user, as {"total": n}.
Read Key Admin switch: Answer rules and forwarding, Read. Read only keys also work.
Parameters
| Name | In | Type | Notes |
|---|---|---|---|
user required | path | string | The user ID, usually their extension number, like 1001. Default ~ Min length 0 Max length 16 |
Example request
curl -X GET "https://api.noodlevoice.com/ns-api/v2/domains/~/users/1001/answerrules/count" \
-H "Authorization: Bearer $NOODLEVOICE_KEY"const res = await fetch("https://api.noodlevoice.com/ns-api/v2/domains/~/users/1001/answerrules/count", {
method: "GET",
headers: {
Authorization: "Bearer " + process.env.NOODLEVOICE_KEY,
},
});
const data = await res.json();import os, requests
r = requests.get(
"https://api.noodlevoice.com/ns-api/v2/domains/~/users/1001/answerrules/count",
headers={"Authorization": "Bearer " + os.environ["NOODLEVOICE_KEY"]},
)
print(r.status_code, r.json())Response 200
{
"total": 1
}Response fields (1)
| Field | Type | Notes |
|---|---|---|
total | integer | How many items matched. |
Other responses: 400, 401, 403, 404. See errors.
Get an answer rule
/domains/~/users/{user}/answerrules/{timeframe}Returns one of a user's answer rules, by the name of its time frame.
Read Key Admin switch: Answer rules and forwarding, Read. Read only keys also work.
Parameters
| Name | In | Type | Notes |
|---|---|---|---|
user required | path | string | The user ID, usually their extension number, like 1001. Default ~ Min length 0 Max length 16 |
timeframe required | path | string | The name of the time frame the answer rule uses. |
Example request
curl -X GET "https://api.noodlevoice.com/ns-api/v2/domains/~/users/1001/answerrules/Business%20Hours" \
-H "Authorization: Bearer $NOODLEVOICE_KEY"const res = await fetch("https://api.noodlevoice.com/ns-api/v2/domains/~/users/1001/answerrules/Business%20Hours", {
method: "GET",
headers: {
Authorization: "Bearer " + process.env.NOODLEVOICE_KEY,
},
});
const data = await res.json();import os, requests
r = requests.get(
"https://api.noodlevoice.com/ns-api/v2/domains/~/users/1001/answerrules/Business%20Hours",
headers={"Authorization": "Bearer " + os.environ["NOODLEVOICE_KEY"]},
)
print(r.status_code, r.json())Response 200
{
"domain": "string",
"user": "1001",
"time-frame": "string",
"enabled": "yes",
"is-active": true,
"order": 99,
"simultaneous-ring": {
"enabled": "yes"
},
"do-not-disturb": {
"enabled": "yes"
},
"...": "12 more fields"
}Response fields (49)
| Field | Type | Notes |
|---|---|---|
domain | string | The account the item belongs to. Max length 64 |
user | string | The user ID (extension). |
time-frame | string | |
enabled | string | Whether it is turned on (yes or no). One of: yes, no Default yes |
is-active | boolean | |
order | integer | Order of the item. Default 99 Min 0 |
simultaneous-ring | object | |
simultaneous-ring.enabled | string | Whether it is turned on (yes or no). One of: yes, no Default no |
simultaneous-ring.parameters | array of any | |
do-not-disturb | object | |
do-not-disturb.enabled | string | Whether it is turned on (yes or no). One of: yes, no Default no |
forward-always | object | |
forward-always.enabled | string | Whether it is turned on (yes or no). One of: yes, no Default no |
forward-always.parameters | array of any | |
forward-on-active | object | |
forward-on-active.enabled | string | Whether it is turned on (yes or no). One of: yes, no Default no |
forward-on-active.parameters | array of any | |
forward-on-busy | object | |
forward-on-busy.enabled | string | Whether it is turned on (yes or no). One of: yes, no Default no |
forward-on-busy.parameters | array of any | |
forward-no-answer | object | |
forward-no-answer.enabled | string | Whether it is turned on (yes or no). One of: yes, no Default no |
forward-no-answer.parameters | array of any | |
forward-when-unregistered | object | |
forward-when-unregistered.enabled | string | Whether it is turned on (yes or no). One of: yes, no Default no |
forward-when-unregistered.parameters | array of any | |
forward-on-dnd | object | |
forward-on-dnd.enabled | string | Whether it is turned on (yes or no). One of: yes, no Default no |
forward-on-dnd.parameters | array of any | |
forward-on-spam-call | object | |
forward-on-spam-call.enabled | string | Whether it is turned on (yes or no). One of: yes, no Default no |
forward-on-spam-call.parameters | array of any | |
call-screening | object | |
call-screening.enabled | string | Whether it is turned on (yes or no). One of: yes, no Default no |
phone-numbers-to-allow | object | |
phone-numbers-to-allow.enabled | string | Whether it is turned on (yes or no). One of: yes, no Default no |
phone-numbers-to-allow.parameters | array of any | |
new-position | string | One of: top, bottom |
phone-numbers-to-reject | object | |
phone-numbers-to-reject.enabled | string | Whether it is turned on (yes or no). One of: yes, no Default no |
phone-numbers-to-reject.parameters | array of any | |
time_range_data | array of object | |
time_range_data[].ordinal-order | integer | |
time_range_data[].start-date | string (date) | Start (date). |
time_range_data[].end-date | string (date) | End (date). |
time_range_data[].day-of-week-number | any | Day of week number. |
time_range_data[].start-time | string (time) | Default 00:00 |
time_range_data[].end-time | string (time) | Default 23:59 |
time_range_data[].invert-match | string | One of: yes, no Default no |
Create an answer rule for a user
/domains/~/users/{user}/answerrulesAdds a new answer rule for one user.
Write Key Admin switch: Answer rules and forwarding, Write.
Parameters
| Name | In | Type | Notes |
|---|---|---|---|
user required | path | string | The user ID, usually their extension number, like 1001. Default ~ Min length 0 Max length 16 |
Request body application/json
| Field | Type | Notes |
|---|---|---|
synchronous required | string | Set to yes to wait until the change is finished before the response comes back. One of: yes, no Default no |
time-frame required | string | |
enabled required | string | Whether it is turned on (yes or no). One of: yes, no Default yes |
is-active required | boolean | |
order | integer | Order of the item. Default 99 Min 0 |
simultaneous-ring | object | |
simultaneous-ring.enabled required | string | Whether it is turned on (yes or no). One of: yes, no Default no |
simultaneous-ring.parameters | array of any | |
do-not-disturb | object | |
do-not-disturb.enabled required | string | Whether it is turned on (yes or no). One of: yes, no Default no |
forward-always | object | |
forward-always.enabled required | string | Whether it is turned on (yes or no). One of: yes, no Default no |
forward-always.parameters | array of any | |
forward-on-active | object | |
forward-on-active.enabled required | string | Whether it is turned on (yes or no). One of: yes, no Default no |
forward-on-active.parameters | array of any | |
forward-on-busy | object | |
forward-on-busy.enabled required | string | Whether it is turned on (yes or no). One of: yes, no Default no |
forward-on-busy.parameters | array of any | |
forward-no-answer | object | |
forward-no-answer.enabled required | string | Whether it is turned on (yes or no). One of: yes, no Default no |
forward-no-answer.parameters | array of any | |
forward-when-unregistered | object | |
forward-when-unregistered.enabled required | string | Whether it is turned on (yes or no). One of: yes, no Default no |
forward-when-unregistered.parameters | array of any | |
forward-on-dnd | object | |
forward-on-dnd.enabled required | string | Whether it is turned on (yes or no). One of: yes, no Default no |
forward-on-dnd.parameters | array of any | |
forward-on-spam-call | object | |
forward-on-spam-call.enabled required | string | Whether it is turned on (yes or no). One of: yes, no Default no |
forward-on-spam-call.parameters | array of any | |
call-screening | object | |
call-screening.enabled required | string | Whether it is turned on (yes or no). One of: yes, no Default no |
phone-numbers-to-allow | object | |
phone-numbers-to-allow.enabled | string | Whether it is turned on (yes or no). One of: yes, no Default no |
phone-numbers-to-allow.parameters | array of any | |
new-position | string | One of: top, bottom |
phone-numbers-to-reject | object | |
phone-numbers-to-reject.enabled | string | Whether it is turned on (yes or no). One of: yes, no Default no |
phone-numbers-to-reject.parameters | array of any |
Example request
curl -X POST "https://api.noodlevoice.com/ns-api/v2/domains/~/users/1001/answerrules" \
-H "Authorization: Bearer $NOODLEVOICE_KEY" \
-H "Content-Type: application/json" \
-d '{
"synchronous": "yes",
"time-frame": "string",
"enabled": "yes",
"is-active": true
}'const res = await fetch("https://api.noodlevoice.com/ns-api/v2/domains/~/users/1001/answerrules", {
method: "POST",
headers: {
Authorization: "Bearer " + process.env.NOODLEVOICE_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
"synchronous": "yes",
"time-frame": "string",
"enabled": "yes",
"is-active": true
}),
});
const data = await res.json();import os, requests
r = requests.post(
"https://api.noodlevoice.com/ns-api/v2/domains/~/users/1001/answerrules",
headers={"Authorization": "Bearer " + os.environ["NOODLEVOICE_KEY"]},
json={
"synchronous": "yes",
"time-frame": "string",
"enabled": "yes",
"is-active": True
},
)
print(r.status_code, r.json())Response 202
Returns a status code with a short JSON message.
Reorder a user's answer rules
/domains/~/users/{user}/answerrules/reorderSets the order answer rules are checked in. The first rule whose time frame matches wins.
Write Key Admin switch: Answer rules and forwarding, Write.
Parameters
| Name | In | Type | Notes |
|---|---|---|---|
user required | path | string | The user ID, usually their extension number, like 1001. Default ~ Min length 0 Max length 16 |
Example request
curl -X PUT "https://api.noodlevoice.com/ns-api/v2/domains/~/users/1001/answerrules/reorder" \
-H "Authorization: Bearer $NOODLEVOICE_KEY" \
-H "Content-Type: application/json" \
-d '[
{
"time-frame": "string"
}
]'const res = await fetch("https://api.noodlevoice.com/ns-api/v2/domains/~/users/1001/answerrules/reorder", {
method: "PUT",
headers: {
Authorization: "Bearer " + process.env.NOODLEVOICE_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify([
{
"time-frame": "string"
}
]),
});
const data = await res.json();import os, requests
r = requests.put(
"https://api.noodlevoice.com/ns-api/v2/domains/~/users/1001/answerrules/reorder",
headers={"Authorization": "Bearer " + os.environ["NOODLEVOICE_KEY"]},
json=[
{
"time-frame": "string"
}
],
)
print(r.status_code, r.json())Response 202
{
"code": 1,
"message": "Hello from NoodleVoice"
}Response fields (2)
| Field | Type | Notes |
|---|---|---|
code | integer | HTTP status code. |
message | string | What happened, in words. |
Other responses: 400, 404. See errors.
Update a user's answer rule
/domains/~/users/{user}/answerrules/{timeframe}Changes one of a user's answer rules.
Write Key Admin switch: Answer rules and forwarding, Write.
Parameters
| Name | In | Type | Notes |
|---|---|---|---|
user required | path | string | The user ID, usually their extension number, like 1001. Default ~ Min length 0 Max length 16 |
timeframe required | path | string | The name of the time frame the answer rule uses. |
Request body application/json
| Field | Type | Notes |
|---|---|---|
enabled required | string | Whether it is turned on (yes or no). One of: yes, no Default yes |
is-active required | boolean | |
order | integer | Order of the item. Default 99 Min 0 |
simultaneous-ring | object | |
simultaneous-ring.enabled required | string | Whether it is turned on (yes or no). One of: yes, no Default no |
simultaneous-ring.parameters | array of any | |
do-not-disturb | object | |
do-not-disturb.enabled required | string | Whether it is turned on (yes or no). One of: yes, no Default no |
forward-always | object | |
forward-always.enabled required | string | Whether it is turned on (yes or no). One of: yes, no Default no |
forward-always.parameters | array of any | |
forward-on-active | object | |
forward-on-active.enabled required | string | Whether it is turned on (yes or no). One of: yes, no Default no |
forward-on-active.parameters | array of any | |
forward-on-busy | object | |
forward-on-busy.enabled required | string | Whether it is turned on (yes or no). One of: yes, no Default no |
forward-on-busy.parameters | array of any | |
forward-no-answer | object | |
forward-no-answer.enabled required | string | Whether it is turned on (yes or no). One of: yes, no Default no |
forward-no-answer.parameters | array of any | |
forward-when-unregistered | object | |
forward-when-unregistered.enabled required | string | Whether it is turned on (yes or no). One of: yes, no Default no |
forward-when-unregistered.parameters | array of any | |
forward-on-dnd | object | |
forward-on-dnd.enabled required | string | Whether it is turned on (yes or no). One of: yes, no Default no |
forward-on-dnd.parameters | array of any | |
forward-on-spam-call | object | |
forward-on-spam-call.enabled required | string | Whether it is turned on (yes or no). One of: yes, no Default no |
forward-on-spam-call.parameters | array of any | |
call-screening | object | |
call-screening.enabled required | string | Whether it is turned on (yes or no). One of: yes, no Default no |
phone-numbers-to-allow | object | |
phone-numbers-to-allow.enabled | string | Whether it is turned on (yes or no). One of: yes, no Default no |
phone-numbers-to-allow.parameters | array of any | |
new-position | string | One of: top, bottom |
phone-numbers-to-reject | object | |
phone-numbers-to-reject.enabled | string | Whether it is turned on (yes or no). One of: yes, no Default no |
phone-numbers-to-reject.parameters | array of any |
Example request
curl -X PUT "https://api.noodlevoice.com/ns-api/v2/domains/~/users/1001/answerrules/Business%20Hours" \
-H "Authorization: Bearer $NOODLEVOICE_KEY" \
-H "Content-Type: application/json" \
-d '{
"enabled": "yes",
"is-active": true
}'const res = await fetch("https://api.noodlevoice.com/ns-api/v2/domains/~/users/1001/answerrules/Business%20Hours", {
method: "PUT",
headers: {
Authorization: "Bearer " + process.env.NOODLEVOICE_KEY,
"Content-Type": "application/json",
},
body: JSON.stringify({
"enabled": "yes",
"is-active": true
}),
});
const data = await res.json();import os, requests
r = requests.put(
"https://api.noodlevoice.com/ns-api/v2/domains/~/users/1001/answerrules/Business%20Hours",
headers={"Authorization": "Bearer " + os.environ["NOODLEVOICE_KEY"]},
json={
"enabled": "yes",
"is-active": True
},
)
print(r.status_code, r.json())Response 202
Returns a status code with a short JSON message.
Delete a user's answer rule
/domains/~/users/{user}/answerrules/{timeframe}Removes one of a user's answer rules. This can't be undone.
Write Key Admin switch: Answer rules and forwarding, Write.
Parameters
| Name | In | Type | Notes |
|---|---|---|---|
user required | path | string | The user ID, usually their extension number, like 1001. Default ~ Min length 0 Max length 16 |
timeframe required | path | string | The name of the time frame the answer rule uses. |
Example request
curl -X DELETE "https://api.noodlevoice.com/ns-api/v2/domains/~/users/1001/answerrules/Business%20Hours" \
-H "Authorization: Bearer $NOODLEVOICE_KEY"const res = await fetch("https://api.noodlevoice.com/ns-api/v2/domains/~/users/1001/answerrules/Business%20Hours", {
method: "DELETE",
headers: {
Authorization: "Bearer " + process.env.NOODLEVOICE_KEY,
},
});
const data = await res.json();import os, requests
r = requests.delete(
"https://api.noodlevoice.com/ns-api/v2/domains/~/users/1001/answerrules/Business%20Hours",
headers={"Authorization": "Bearer " + os.environ["NOODLEVOICE_KEY"]},
)
print(r.status_code, r.json())Response 202
{
"code": 1,
"message": "Hello from NoodleVoice"
}Response fields (2)
| Field | Type | Notes |
|---|---|---|
code | integer | HTTP status code. |
message | string | What happened, in words. |