question

Mathias Schuch avatar image
Mathias Schuch asked Phong Vu commented

Why I can't remove phone line from device

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

extensionphone numbers
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Phong Vu avatar image
Phong Vu answered

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.

1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Mathias Schuch avatar image
Mathias Schuch answered

Yes this was problem.

Thank you

1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Mathias Schuch avatar image
Mathias Schuch answered Phong Vu commented

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" } ] }

5 comments
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Phong Vu avatar image Phong Vu ♦♦ commented ·

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

0 Likes 0 ·
Tru Le Cong avatar image Tru Le Cong Phong Vu ♦♦ commented ·

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 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

0 Likes 0 ·
Phong Vu avatar image Phong Vu ♦♦ Tru Le Cong commented ·

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

0 Likes 0 ·
1712598238313.png (30.0 KiB)
1712598303879.png (39.6 KiB)
Show more comments

Developer sandbox tools

Using the RingCentral Phone for Desktop, you can dial or receive test calls, send and receive test SMS or Fax messages in your sandbox environment.

Download RingCentral Phone for Desktop:

Tip: switch to the "sandbox mode" before logging in the app:

  • On MacOS: press "fn + command + f2" keys
  • On Windows: press "Ctrl + F2" keys