garimabalodi | 2023-08-29 09:43:24 UTC | #1
Hi Dev Forum,
I am looking to update my remote phone address through platform API. Currently , i have assigned my mobile number to a remote phone in Genesys , and I need to update this with another mobile number . Below is an api that i figured out to use . Is the choice of API correct ? If yes, why am i getting the error in response .
PUT /api/v2/telephony/providers/edges/phones/22915c57-b513-4d9a-bcd3-ff53ce1f3930 (last bit is my remote phone id).
With The body and response are as follows .
I am passing the body as follows :-
{ "name": "garimaRemote",
"site": { "id": "6f143f33-3ee3-4106-a2e0-ac405ac82ef1" }, "phoneBaseSettings": { "id": "9c8f156c-bdb9-4b49-a74c-80d0fb33c116" },
"lines": [ { "name": "garimaRemote1", "properties": { "stationlabel": { "type": "string", "value": { "default": "Remote Phone" } }, "stationremoteaddress": { "type": "string", "value": { "default": null, "instance": "+918408040927" }, "required": true } } } ],
"properties": {} }
Response : - { "message": "StationV2 with name 'garimaRemote1' already exists.", "code": "general.bad.request", "status": 400, "messageWithParams": "{entityName} with {fieldName} '{value}' already exists.", "messageParams": { "entityName": "StationV2", "fieldName": "name", "value": "garimaRemote1" }, "contextId": "1445edc6-41b3-4b12-8685-fb29aac6d30c", "details": [ { "errorCode": "DUPLICATELINENAME", "fieldName": "lines[0].name" } ], "errors": [] }
Regards Garima
garimabalodi | 2023-08-30 09:47:44 UTC | #2
Hi Dev forum ,
I was able to update the phone number using update api by passing body as follows .
However , as per the api documentation lineBaseSettings is not mandatory . But, if it is not provided in the body , we get this misleading error : "message": "Field 'templateId' is required and cannot be empty." (template id is another field which is not a mandatory field). It would be nice to be confirmed on this by someone though.
the success body :- { "name": "garimaRemote",
"site": { "id": "6f143f33-3ee3-4106-a2e0-ac4xxxxx2ef1" }, "phoneBaseSettings": { "id": "9c8f156c-bdb9xxxxxx-80d0fb33c116"
},
"lines": [ { "name": "garimaRemote_16", "properties": {
"stationremoteaddress": { "type": "string", "value": { "instance": "+918xxxxxx921" } } } , "lineBaseSettings": { "id": "9fd3aexxxxxx05d07"} } ] }
Regards Garima.
Declan_ginty | 2023-09-04 10:56:57 UTC | #3
Hi Garima,
Thank you for pointing this out, I will contact the team in charge of this endpoint and see about changing the documentation.
Regards, Declan
system | 2023-10-05 10:56:57 UTC | #4
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: 21744