Hello,
I have multiple phone numbers in inventory. I want to be able to assign a phone number to an extension I created.
I tried this PATCH command, but it keeps saying the extensionID number is not found: https://developers.ringcentral.com/api-reference/Phone-Numbers/assignPhoneNumberV2
I even tried to do a get of the extension number I want to use, using this GET commad: https://developers.ringcentral.com/api-reference/Phone-Numbers/listExtensionPhoneNumbers
But it still can't find the extension number, it can only show me the results of all the extensions I have in my ringcentral account if I uses the tilde "~"
Is it possible to assign phone numbers to an user's extension? I want to be able to assign a phone number to an extension I created, and have that number be the primary fax and fax only number type.
Where did you get the extension id and make sure that it's valid.
Show me the code how you call the PATCH method to assign a number.
Is the extension number itself the extensionID? For example, when I GET info for an account, this is the response:
{ "schemas": [ "urn:ietf:params:scim:api:messages:2.0:ListResponse" ], "totalResults": 1, "startIndex": 1, "itemsPerPage": 100, "Resources": [ { "schemas": [ "urn:ietf:params:scim:schemas:core:2.0:User" ], "id": "63548308004", "meta": { "resourceType": "User", "created": "2023-11-15T19:17:30.342Z", "lastModified": "2023-11-15T19:17:30.342Z", "location": "https://platform.ringcentral.com/scim/v2/Users/63548308004" }, "userName": "test.user15@wellthy.com", "name": { "formatted": "Test User15", "familyName": "User15", "givenName": "Test" }, "active": true, "emails": [ { "value": "test.user15@wellthy.com", "type": "work" } ], "phoneNumbers": [ { "value": "326", "type": "other" } ] } ] }
So is "326" the extenstion ID? Because when I try to do a get extension phone number list, it gives a 404 when I enter extensionID as 326:
curl --request GET \ --url 'https://platform.ringcentral.com/restapi/v1.0/account/~/extension/326/phone-number?page=1&perPage=100'\
{ "errorCode": "CMN-102", "message": "Resource for parameter [extensionId] is not found", "errors": [ { "errorCode": "CMN-102", "message": "Resource for parameter [extensionId] is not found", "parameterName": "extensionId" } ], "parameterName": "extensionId" }
I also want to make sure that I am not changing the company number for our entire account, just the direct number for the user using the extension.
EDIT: I found the issue, I needed to use the "id" not the extension number. I am able to add a phone line now!
The only other thing I have to figure out is if there is an API to make the phone number type fax only,
And also if there is an API that can make that primary number as the caller ID for fax number in user's profile
That is the thing. Extension id (an identifier) is different than extension number (a label).
Don't specify the type when assign a phone number. For some reason, it causes a error Bad request. I will report this to get it fixed.
Great, thanks! But do you know if there is an API to do the other steps I wanted: make the phone number fax only and also make the primary number as the caller ID for fax number?
For changing the phone number type, it was intended to support via the "type" parameter in the update phone number API. But it seems that it would not work that way. So the team may need to provide a different API to do that.
For changing the Fax caller id, use this API instead. Here is the sample code in Node JS to read an extension phone numbers and assign the fax caller id.
async function read_extension_phonenumber(){ var endpoint = "/restapi/v1.0/account/~/extension/~/phone-number" var params = { usageType: ["DirectNumber"] } var resp = await platform.get(endpoint, params) var jsonObj = await resp.json() for (var record of jsonObj.records){ if (record.phoneNumber == '+1209683xxxx'){ set_extension_fax_caller_id(record.id) break } } } async function set_extension_fax_caller_id(phoneId){ var endpoint = "/restapi/v1.0/account/~/extension/~/caller-id" var bodyParams = { byFeature: [ { feature: "FaxNumber", callerId: { type: "PhoneNumber", phoneInfo: { id: phoneId } } } ] } var resp = await platform.put(endpoint, bodyParams) var jsonObj = await resp.json() console.log(jsonObj) }
I don't remember if the extension primary number can be set via API or not. But I will have search for it and update you later.
great, that worked! looking forward to the devs fixing the voicefax type issue.
A new Community is coming to RingCentral!
Posts are currently read-only as we transition into our new platform.We thank you for your patience
during this downtime.
Try Workflow Builder
Did you know you can easily automate tasks like responding to SMS, team messages, and more? Plus it's included with RingCentral Video and RingEX plans!Try RingCentral Workflow Builder