question

frankstillone avatar image
frankstillone asked

How do I activate and Deactivate a number via the api

Hi there, I would like to be able to activate and deactivate a number via the api.

I am using GET https://api.telnyx.com/v2/phone_numbers/+61####.... to get the number information I am in Aus so +61

I believe I then use: PATCH https://api.telnyx.com/v2/phone_numbers/+61####.... with body as follows: { "data": {"connection_id":""}

}

The intention being that I clear out the connection which renders the number inactive. I would then use the same PATCH API call with the bodying being { "data": {"connection_id":"theconnectionid"}

} to reactivate the number

This is not working.

Am I doing something wrong?

Thans Frank

phone-numbers
10 |600

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

1 Answer

·
klane@telnyx.com avatar image
klane@telnyx.com answered

Hi Frank

I love that you are working out the APIs. I want to make sure we get you rolling.

You said connection so I am assuming you meant you want to clear the sip connection. Can you check if the kind of sip connection command you need is here - https://devdocs.telnyx.com/openapi/connections/#tag/Connections depending on the kind of sip connection you are using.

Please let me know if that works for you.

10 |600

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

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

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

Manage Your Content