News & Announcements User Community Developer Community

Welcome to the RingCentral Community

Please note the community is currently under maintenance and is read-only.

Search
Make sure to review our Terms of Use and Community Guidelines.
  Please note the community is currently under maintenance and is read-only.
Home » Developers
Why I can't remove phone line from device
Tags: phone numbers, extension
Apr 2, 2024 at 7:00am   •   3 replies  •  0 likes
Mathias Schuch

I have tried to delete a phone from a device:

DELETE https://platform.devtest.ringcentral.com/restapi/v2/accounts/accountId/devices/deviceId

but I got the error:

"message": "The line can not be removed from the unassigned device.",
"errorCode": "DEV-353"

What does it mean? What is wrong here?

Thanks

3 Answers
answered on Apr 5, 2024 at 5:32am  

Yes this was problem.

Thank you


 0
answered on Apr 5, 2024 at 5:43am  

But now I have another issue.I want to assign this phone number to an other extension with:
Phone Numbers - Assign Phone Number

But with this request

curl --request PATCH \

--url 'https://platform.devtest.ringcentral.com/restapi/v2/accounts/~/phone-numbers/400408004' \

--data '{"usageType":"PhoneLine","extension":{"id":"896916005"},"type":"VoiceFax"}'

I got the follwing error:

{

"errors": [

{

"errorCode": "CMN-101",

"message": "Parameter [type] value is invalid",

"parameterName": "type"

}

]

}

I tried also other types but every time the same error


{ "errors": [ { "errorCode": "CMN-101", "message": "Parameter [type] Wert ist ungültig.", "parameterName": "type" } ] }


 0
on Apr 5, 2024 at 10:39am   •  0 likes

Don't set the type parameter. OR if you set it, it must be the same as the type of that number. You can read the number info using this API.

Note: This does not support PhoneLine (Digital Line). Only CompanyNumber and DirectNumber

on Apr 7, 2024 at 8:07am   •  0 likes

Dear Phong,


After successfully executing the step to remove the phone line, the phone number has been returned to the inventory phone number list, and the UsageType has been changed to 'CompanyNumber'.


DELETE https://platform.devtest.ringcentral.com/restapi/v2/accounts/~/devices/<Device ID>

accept: application/json

content-type: application/json

authorization: Bearer <ACCESS TOKEN>


Request:

{"keepAssetsInInventory":true}


Subsequently, I attempted to reassign the phone number to the extension, but encountered an error. Here are the details:


PATCH https://platform.devtest.ringcentral.com/restapi/v2/accounts/~/phone-numbers/400408004

accept: application/json

content-type: application/json

authorization: Bearer <ACCESS TOKEN>


Request 1:

{"usageType":"DirectNumber","extension":{"id":"899541005"}}


Response 1:

{

"errors": [

{

"errorCode": "CMN-203",

"message": "Internal Server Error"

}

]

}


Request 2:

{"usageType":"CompanyNumber","extension":{"id":"899541005"}}


Response 2:

{

"errors": [

{

"errorCode": "CMN-101",

"message": "Parameter [extension] value is invalid.",

"parameterName": "extension"

}

]

}


More information with phonenumber:

{

"uri": "https://platform.devtest.ringcentral.com/restapi/v1.0/account/~/phone-number/400408004",

"id": 400408004,

"phoneNumber": "+19492348573",

"paymentType": "Local",

"location": "Laguna Beach, CA",

"type": "VoiceFax",

"usageType": "CompanyNumber",

"status": "Normal",

"primary": false

}


Extension information:

{

"uri": "https://platform.devtest.ringcentral.com/restapi/v1.0/account/~/extension/899541005",

"id": 899541005,

"extensionNumber": "109",

"contact": {

"firstName": "VNTeam-109",

"lastName": "Team",

"email": "lecongtru.mi@gmail.com",

"emailAsLoginName": false,

"pronouncedName": {

"type": "Default",

"text": "VNTeam-109 Team"

}

},

"name": "VNTeam-109 Team",

"type": "User",

"status": "Enabled",

...

}


Best Regards,

Le Cong Tru

on Apr 8, 2024 at 10:45am   •  0 likes

This is your sandbox account and you have max 4 numbers. All numbers are associated with a device so they are digital line (phone line).

I don't see any phone line under this account are unassigned or in the inventory!

1712598238313.png

If you want to play with the assign phone number API in this account, you have to login the account service web, open the device and select the "Remove Line" option to detach the number from a device. Choose the option to keep the number in the inventory then you can assign that number to an extension.

1712598303879.png

on Apr 10, 2024 at 4:02pm   •  0 likes

Dear Phong,

I released another phone number to inventory.

1712790112661.png


And attempted to reassign that phone number again:

Request:

PATCH https://platform.devtest.ringcentral.com/restapi/v2/accounts/~/phone-numbers/375900005

accept: application/json

content-type: application/json

authorization: Bearer <ACCESS TOKEN>


{"usageType":"DirectNumber","extension":{"id":"899541005"}}

Response:

The RCRequestId of response in case you need:

RCRequestId: 8b9c30fa-f78d-11ee-9b34-005056bb9d9e

1712789819369.png

Best Regards,

Le Cong Tru

on Apr 10, 2024 at 4:34pm   •  0 likes

Everything looks correct now. So the problem could be that this is a new (beta) API and it might not be supported in the sandbox environment.

Unfortunately, I cannot quickly test on my sandbox account to verify the reason. But I am still so sure that it is the cause. And I can confirm that this works on production environment.

answered on Apr 2, 2024 at 7:52am  

Based on the error message, it seems that you attempted to remove the phone line from a device which has not been assigned to any extension. Please check if it is the case.

The API is for unassigning a device which was assigned to an extension.


 0



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

PRODUCTS
RingEX
Message
Video
Phone
OPEN ECOSYSTEM
Developer Platform
APIs
Integrated Apps
App Gallery
Developer support
Games and rewards

RESOURCES
Resource center
Blog
Product Releases
Accessibility
QUICK LINKS
App Download
RingCentral App login
Admin Portal Login
Contact Sales
© 1999-2024 RingCentral, Inc. All rights reserved. Legal Privacy Notice Site Map Contact Us