scm_pa | 2020-01-30 18:25:15 UTC | #1
I'm looking to programmatically create a new phones Base Settings and modify some of the configuration settings (eg. codecs, signaling protocol). It looks like PhoneBase.Properties is where I would need to do that and is defined as Dictionary<string,Object>. Is Object expected to be Json formatted or does the Object get serialized/deserialized in the .NET library? Thanks in advance.
tim.smith | 2020-01-30 18:31:47 UTC | #2
Unfortunately, APIs that use that type don't get docs generated for the schema nor do the SDKs provide classes for them. For these situations, you'll have to create and use your own class that serializes correctly for the Object or make this request manually.
Luckily, there is some handwritten documentation for how to use these APIs: https://developer.mypurecloud.com/api/rest/v2/telephonyprovidersedge/create_phone.html
scm_pa | 2020-01-30 21:34:49 UTC | #3
I guess there's my disconnect. What am I serializing to? JSON? XML?
Thank you
tim.smith | 2020-01-30 22:06:57 UTC | #4
JSON, yes. All PureCloud API requests are JSON.
scm_pa | 2020-02-07 19:52:10 UTC | #5
Thank you. A question on the link you provided earlier, for the lines it states "New phones create one line by default". I took that to mean a new line would be created when I call PostTelephonyProvidersEdgesPhones(newPhone) but it fails if newPhone doesn't have a line(s) specified.
So do I need to create a new line before creating the phone or can I just use an existing line?
Thanks.
tim.smith | 2020-02-10 22:37:39 UTC | #6
It's possible that article is out of date. What is the request body you're sending and what error are you getting back?
scm_pa | 2020-02-19 21:51:12 UTC | #7
The error that I get back is {"message":"A phone must contain at least one line.","code":"lines.required","status":400}
I'm using the .NET SDK so to the "body" passed in I'm just assigning the station name, base phone and the site. If I add a line to that then it works.
system | 2020-03-21 21:51:17 UTC | #8
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.
This post was migrated from the old Developer Forum.
ref: 7033