Data Action - Users API

Hey all,

So, we’ve got a data action in an architect flow that’s suddenly failing - it was working fine last week (which, tbh, is always a bad sign). It’s calling the Users API to update a user’s phone number, specifically /api/v2/users/{userId} with a PATCH request.

The error is a straight-up 400 Bad Request, and the response body is… less than helpful. It’s just this:

{
 "message": "Invalid request",
 "code": 400,
 "details": [
 {
 "field": "phoneNumber",
 "message": "Invalid phone number"
 }
 ]
}

Lovely.

The phone number we’re sending is +15551234567 - standard E.164 format, right? It’s being pulled from a variable in the flow, which iirc is populated by a voice gateway transfer, so it should be a valid number. I’ve checked the variable value in the session data - it’s definitely what we expect.

We’re on Genesys Cloud Release 23.6.1.0, using the REST API, and the Postman collection we’re using for testing (and that the data action’s configured with) is pointing to the correct environment. I’ve even tried running the exact same request in Postman with the same userId and the number - works perfectly. It’s just the data action that’s choking.

I suspect it’s something weird with how the data action is serializing the payload. It might be adding extra characters or formatting it incorrectly? I’ve tried encoding the phone number as a string, but still no dice. The data action config is basically just mapping the variable to the phoneNumber field in the request body.

Anyone else seen this? I’m starting to think the API is just being… finicky. It’s a real pain, because we’ve got a bunch of flows using this API endpoint, and if it’s a global issue, we’re in for a fun time. The whole architect flow is basically doing jack all, tbh.

1 Like