Updating remote phone adress through API

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": "garimaRemote_1",
"properties": {
"station_label": {
"type": "string",
"value": {
"default": "Remote Phone"
}
},
"station_remote_address": {
"type": "string",
"value": {
"default": null,
"instance": "+918408040927"
},
"required": true
}
}
}
],

"properties": {}
}

Response : -
{
"message": "StationV2 with name 'garimaRemote_1' already exists.",
"code": "general.bad.request",
"status": 400,
"messageWithParams": "{entityName} with {fieldName} '{value}' already exists.",
"messageParams": {
"entityName": "StationV2",
"fieldName": "name",
"value": "garimaRemote_1"
},
"contextId": "1445edc6-41b3-4b12-8685-fb29aac6d30c",
"details": [
{
"errorCode": "DUPLICATE_LINE_NAME",
"fieldName": "lines[0].name"
}
],
"errors": []
}

Regards
Garima

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": {

    "station_remote_address": {
      "type": "string",
      "value": {
        "instance": "+918xxxxxx921"
      }
    }
  }
  ,
      "lineBaseSettings": {
    "id": "9fd3aexxxxxx05d07"}
  }

]
}

Regards
Garima.

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

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