Assigning phone number to user

So far I wrote a script that extracts a free 10 digit number, meaning it’s not assigned and I get it using GET List phone numbers. After that I use GET List phone users to extract user_id.

From here I’m trying to utilize POST Assign phone number to user to provision that user with the free number. Here is the example of the POST body:

{
  "phone_numbers": [
    {
      "id": "id1234",
      "number": "+19041234567"
    }
  ]
}

And I keep getting this:

{
    "code": 1001,
    "message": "User does not exist: :userId."
}

I’ve verified that user exists and I’m using the ‘id’ key and value from GET List phone users and not sure why I’m getting this message. Please help. This is the last part that I need to get working.

Figured it out. User ID goes within the actual POST URL:

{{baseUrl}}/phone/users/id1234/phone_numbers

POST body should be:

{
  "phone_numbers": [
    {
      "id": "phone_id1234",
      "number": "+19041234567"
    }
  ]
}