hello,
I created an API request with cUrl to give access to a folder to an external user. I used the collaboration request and it worked for a very few folders and doesn’t work with most of them.
Here is my request
#!/bin/bash
# Set your Box API key and access token
API_KEY="xoxp-My Api Key"
ACCESS_TOKEN="My valid Token"
# Set the folder ID to which you want to invite the user
FOLDER_ID="198762389512"
# Set the email address of the user you want to invite USER_EMAIL="stephanepiot09@gmail.com"
# Set the collaboration role to "viewer"
COLLAB_ROLE="viewer"
# Define the cURL request
curl -X POST "https://api.box.com/2.0/collaborations" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{ "item": {
"id": "'$FOLDER_ID'",
"type": "folder"
},
"accessible_by": {
"login": "'$USER_EMAIL'",
"type": "user"
},
"role": "'$COLLAB_ROLE'"
}'
Here is the error message :
{
"type": "error",
"status": 404,
"code": "not_found",
"context_info": {
"errors": [
{
"reason": "invalid_parameter",
"name": "item",
"message": "Invalid value 'd_198762389512'. 'item' with value 'd_198762389512' not found"
}
]
},
"help_url": "http://developers.box.com/docs/#errors",
"message": "Not Found",
"request_id": "nxue9bhjwd1oh7rd"
}
It works well for this folder id : 194483959799

Thanks in advance for your help.
christophe