plmcgrn | 2022-07-26 19:53:21 UTC | #1
Attempting to call this API /api/v2/users/{userId}/station/defaultstation/{stationId}
After creating a WebRTC station for a user via the same script. The PUT request throws back a 404 Station Not Found, even though the {userid} and {stationid} are verified accurate.
{"message":"Station not found","code":"not.found","status":404,"contextId":"59168afe-bfd5-43ec-b609-d19639fbeb16","details":[],"errors":[]}
I'm wondering if this API is only intended to be called via creds tied to a human, vs. tied to an OAuth integration. The fact that the error is "station not found" leads me to believe the OAuth credentials can't see the device it just created. The API documentation notes it needs the "users" OAuth scope, but Client Credentials OAuth clients can't be assigned scopes, from what I can see.
I'm basically trying to remove clicks form new user onboarding, where they'd normally have to select a station in order to use the WebRTC softphone.
John_Carnell | 2022-07-26 20:08:09 UTC | #2
Hi Paul,
I have you take a look at our user-provisioning guide in the developer center. Module 4 covers creating a phone and assigning the default station to the user. It's been a while, but I know with a few of the phone APIs you do have to wait a couple of seconds after the API call because the process is asynchronous and if you immediately try to look up the value after you create the phone you will get an error.
I hope that helps.
Thanks, John Carnell Manager, Developer Engagement
plmcgrn | 2022-07-26 20:27:20 UTC | #3
Hi John, I think I found my issue. It wasn't delay, but was rather lack of my understanding on Station ID. It's actually the Line ID of the Phone that was created, not the ID of the phone itself. I wish the folks that designed these API's were consistent in naming, but I was able to get this going based on using Line ID in the API call originally referenced. I understand (now) what that is, in that a phone can have multiple Lines, but this threw me because we're only using WebRTC with single lines.
John_Carnell | 2022-07-26 20:50:49 UTC | #4
Hi Paul,
Glad to hear you figured it out.
Thanks, John
John_Carnell | 2022-07-26 20:50:57 UTC | #5
This post was migrated from the old Developer Forum.
ref: 15691