Required fields for POST telephony/providers/edges/phones

current payload:

{
	"name": "Adam_Baker_WebRTC",
	"webRtcUser": {
		"id": <id>
	},
	"site": {
		"id": <id>
	},
	"phoneBaseSettings": {
		"id": <id>
	},
	"lines": [
		{
			"templateId": <id>
		}
	]
}

I have also tried with { "template": { "id": and with a name added since the docs say this is required. The name looks to be auto generated though so I am not sure about that.

Error:

{
	"status": 400,
	"code": "general.bad.request",
	"message": "Validation failed for Station.  Errors:  [{\"errorCode\":\"REQUIRED_FIELD\",\"fieldName\":\"templateId\"}].",
	"messageParams": {},
	"contextId": "fe8a2afe-9f6a-4a96-80ea-10f0ba8baeee",
	"details": [
		{
			"errorCode": "REQUIRED_FIELD",
			"fieldName": "lines[0].templateId"
		}
	],
	"errors": []
}

What is the format of this request?

See the guide on creating phones here: https://developer.mypurecloud.com/api/rest/v2/telephonyprovidersedge/create_phone.html. The example at the end is correct and works. While that example doesn't use the templateId property, it's not required with that combination of settings.

BTW, use code blocks to display JSON documents. Entering code as quote blocks messes with your formatting and hides elements that look like HTML tags.

Sorry, missed the code format button.

Most the urls in the document linked were not valid but once I chased up the required values I am still getting the template id error.

I also had a hard time setting things like the phone_hardwareId since there is no hardware. I tried a few combinations, this is an example:

{
	"name": "Adam_Baker_WebRTC",
	"webRtcUser": {
		"id": "b91b41cd-c2d6-41de-baf1-67933bcc273e"
	},
	"edgeGroup": {
		"id": "ac31481e-9807-40c9-89c6-a8aacac65fdb"
	},
	"site": {
		"id": "70b43d4d-526f-448c-acf7-6f7f90b55952"
	},
	"phoneBaseSettings": {
		"id": "dc46d841-39cb-457f-8ffd-ecb1049dcd53"
	},
	"lines": [
		{
			"name": "Adam_TEST",
			"lineBaseSettings": {
					"id": "716329a7-9113-4f08-ba73-04e4e48f8c9c"
			},
			"properties": {
				"station_label": {
					"value": {
						"instance": "WebRTC_1"
					}
				},
				"station_remote_address": {
          "value": {
            "instance": "15555551212"
          }
        },
				 "station_lineLabel": {
          "value": {
            "instance": "TestLine"
          }
        },
				"station_lineKeyPosition": {
					"value": {
						"instance": 0
					}
				}
			}
		}
	], 
	"properties": {
    "phone_hardwareId": {
      "value": {
        "instance": "FF:FF:FF:FF:FF:FF"
      }
    }
  }
}

In the UI that we are trying to replicate it is only necessary to choose Phone Name, Base Setting, Site and Person.

In the UI that we are trying to replicate it is only necessary to choose Phone Name, Base Setting, Site and Person.

If you look in the developer console in your browser when you save the phone, you should see the request to this API to create the phone. You can replicate that request exactly and it should work.

Can you provide a correlation ID for the request above?

Ah, I didn't think of that. Is this what you were looking for? "contextId": "9b00975d-4a28-43ce-a161-4e8207c8ca01"

Just a following up. The payload from the browser was a couple of hundred lines for pretty json, I was able to cut it down to this to get it to work:

{
	"site": {
		"id": "62cd6ec9-7911-408d-af69-6f90da086e4b"
	},
	"phoneBaseSettings": {
		"id": "dc46d841-39cb-457f-8ffd-ecb1049dcd5"
	}, 
	"webRtcUser": {
		"id": "b91b41cd-c2d6-41de-baf1-67933bcc273e"
	},
	"name": "Adam_Baker_WebRTC", 
	"lines": [{
		"lineBaseSettings": {
			"id": "d86300ad-4095-44ae-ba49-7b41ae1f6544"
		}
	}]
}
1 Like

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