Reputation: 11
I have a problem of sending SMS via API within one account where we have a bunch of numbers with their own extensions.
The goal is to be able to use any of these numbers for sending SMS from Salesforce via callout.
I've created an app with "SMS", "Read Account" permissions.
When I try to send a request from Postman using "Account" credentials with or without extension number, I receive an error: "Phone number doesn't belong to extension"
I cannot log in with default account credentials and different extensions. I do not have other users credentials. I cannot add number to extension as it already have own extension.
Is there any way I can solve this? Please, advice.
Upvotes: 1
Views: 186
Reputation: 16354
For now, you need to use an access token authorized by a user (extension) that has privileges to send/receive SMS on the numbers desired.
Given the scenario you describe, you will need to add a degree of indirection between the user taking the action and the user extension to which the number is associated.
To do this, you will need to build an app that manages access tokens for the extensions to which the numbers are assigned. Then your user will need to separately log into the app and select the number, at which time the app will use it's separately managed access token.
The authorization for user extensions associated with the numbers may be able to be authorized using OAuth 2.0 Authorization grant flow or, if your app is a private app the OAuth 2.0 Resource Owner Password Credentials grant flow.
Upvotes: 1