I managed to successfully register a beacon using the proximity API and can see it when a list the active beacons, but I'm unable to modify the beacon information using the update method.
Here's the successful registration packed
{
"beaconName": "beacons/3!6564643165626561653336383637373435326335",
"advertisedId": {
"type": "EDDYSTONE",
"id": "ZWRkMWViZWFlMzY4Njc3NDUyYzU="
},
"status": "ACTIVE",
"latLng": {
"latitude": <removed>,
"longitude": <removed>
}
}
and here's the result of the list action GET https://proximitybeacon.googleapis.com/v1beta1/beacons
{
"beacons": [
{
"beaconName": "beacons/3!6564643165626561653336383637373435326335",
"advertisedId": {
"type": "EDDYSTONE",
"id": "ZWRkMWViZWFlMzY4Njc3NDUyYzU="
},
"status": "ACTIVE",
"latLng": {
"latitude": <removed>,
"longitude": <removed>
}
}
]
}
However trying to call a PUT to update gives me a 400 PUT /v1beta1/beacons/3%216564643165626561653336383637373435326335
{
"error": {
"code": 400,
"message": "Invalid JSON payload received. Unknown name \"{ \"status\": \"ACTIVE\", \"latLng\": { \"latitude\": <removed>, \"longitude\": <removed> }}\": Cannot bind query parameter. Field '{ \"status\": \"ACTIVE\", \"latLng\": { \"latitude\": -35' could not be found in request message.",
"status": "INVALID_ARGUMENT",
"details": [
{
"@type": "type.googleapis.com/google.rpc.BadRequest",
"fieldViolations": [
{
"description": "Invalid JSON payload received. Unknown name \"{ \"status\": \"ACTIVE\", \"latLng\": { \"latitude\": <removed>, \"longitude\": <removed> }}\": Cannot bind query parameter. Field '{ \"status\": \"ACTIVE\", \"latLng\": { \"latitude\": -35' could not be found in request message."
}
]
}
]
}
}
The packet itself is pretty simple
{
"status":"ACTIVE",
"latLng": {
"latitude": <removed>,
"longitude": <removed>
},
"indoorLevel": {
"name": "4"
},
"status": "PORTABLE"
}
Not entirely sure what the cause of the error is and how to resolve.
Own question answered. This is the error you get if you forget to pass in a header of "Content-Type: application/json" when using curl.