403 Error when trying to unlock asset

This what I get:

“type”: “ForbiddenError”,
“status”: 403,
“message”: “You don’t have permission to lock or unlock assets for this user”

I’m able to list my assets so I know I’m properly connected to the API.

I’m using the following Raw JSON
{
“data”: {
“userId” : “637573e1b7ce9c00083ceXXX”
}
}

what am I missing here??

Thank you!

1 Like

Stumbled upon this one as well.
Here is what worked for me:

  1. your api key provided as a header x-api-key must have WRITE permission as described in docs.
  2. Do not use Authorization header for locking/unlocking

So here is the diff between API calls:
/assets:
curl -H ‘Content-Type: application/json’ -H ‘x-api-key: sk_live_O…’ -H ‘Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6…’ -H ‘X-APP-ID: 675b5…’ ‘https://api.readyplayer.me/v1/assets?filter=viewable-by-user-and-app&filterAllowLocked=true&filterApplicationId=675b5219...&order=editorPosition&bodyType=generic&bodyType=fullbody&gender=neutral&limit=20&page=1&type=top&gender=female&filterUserId=67a8f4b8b22…’

/unlock:
curl -X PUT -H ‘Content-Type: application/json’ -H ‘x-api-key: sk_live_O…’ -H ‘X-APP-ID: 675b52…’ -d ‘{“data”:{“userId”:“67a8f4…”}}’ ‘https://api.readyplayer.me/v1/assets/808b5.../unlock

1 Like