question

meandrik avatar image
meandrik asked

Can't delete phone number - bug in the API?

It looks like I found a bug in the API that deletes a phone number:

https://developers.telnyx.com/docs/api/v2/numbers/Number-Configurations?lang=node#deletePhoneNumber

The code is very simple and it was copied from example snippet as is. It throws the error:

TelnyxResourceNotFoundError: (Status 404) Resource not found

I use Node library. But I also tried to use REST. Both methods throw the same error. Could anyone check that please?

phone-numberserrordebugging
1 comment
10 |600

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

klane@telnyx.com avatar image klane@telnyx.com ♦♦ commented ·

Thanks for bringing this to our attention! We want to make sure the documentation is accurate and helpful. I have logged it for review by our developer team so stay tuned for updates.

0 Likes 0 ·

1 Answer

$$ANON_USER$$ avatar image
$$ANON_USER$$ answered

I found the mistake. Instead of phone number ID, the phone number itself should be sent.

const { data: phoneNumber } = await telnyx.phoneNumbers.del('+1999821123');

Despite the fact that documentation sais to send ID.

1 comment
10 |600

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

klane@telnyx.com avatar image klane@telnyx.com ♦♦ commented ·

Wow, I love your resilience and thanks for posting the solution! I will have the docs reviewed for accuracy in this regard.

0 Likes 0 ·

Manage Your Content