Enabling SMS on user account via API

Description
I am trying to script out creating a user account and I’m getting stuck on enabling SMS (the option you find in Admin > Phone System Management > Users & Rooms > UserEmail > Policy). We have SMS enabled on the company so via the GUI I can just toggle SMS on. Below is the API I’m trying to run.

$userProfileBody =@{
“policy” = @{
“sms” = @{
“enable” = $True;
“international_sms” = $False
}
}
} | ConvertTo-Json

$summaryUri = $baseUri + “/phone/users/$userID”
$summaryResponse = Invoke-RestMethod -Method Patch -Uri $summaryUri -ContentType application/json -Headers $requestHeader -Body $userProfileBody

Error
Invoke-RestMethod : {“code”:400,“message”:“Could not modify SMS and International SMS at the same time”}

If I remove the “international_sms” setting from the policy block I instead get this error:
Invoke-RestMethod : {“code”:400,“message”:“International SMS is blocked by Admin.”}

Which App Type (OAuth / Chatbot / JWT / Webhook)?
JWT

Which Endpoint/s?
https://api.zoom.us/v2/phone/users/{userId}

Hi @anton.dobschensky

Thanks for reaching out to the Zoom Developer Forum and welcome to our community! I am happy you are here! I will go ahead and try to replicate this issue on my side.
Could you please confirm if you are calling the Update user’s profile endpoint?
https://marketplace.zoom.us/docs/api-reference/phone/methods#operation/updateUserProfile

Best,
Elisa

Hi Elisa,

Yes, that is what I’m using. In the web’s documentation it mentions the 400 errors I’m getting, I just can’t seem to find a way around it using the API. It is only the SMS I’m having trouble with. {policy: SMS: {enable: True, international_sms: false}}

Hi @anton.dobschensky
I was able to replicate this issue on my side.
I am trying to figure out how to fix this or how to come up with a workaround.
Can you please try and go to your account settings and enable SMS

Thanks
Elisa

If you meant in Company Info > Account Settings > Policy, then SMS is enabled there (Allow International SMS is not which is correct for our use). This doesn’t seem to default Users to enabled as we originally thought it might.

In Users & Rooms > [user] > Policy, I am able to toggle on SMS, so it does work through the web interface. We’re looking to not need to go in here to manually enable it on everyone we onboard.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.