Content
You are here:
API: Unable to create membership
Added by Xavi M. over 4 years ago
Dear,
I have projects and users but I can't create a membership between a project and a user by using API request.
Here is an attemptĀ
curl -s -H "Content-Type: application/json" \
--data-urlencode 'filters=[{"project":{"operator":"=","values":["10"]}}]' \
-d '{"_links":{"principal":{"name":"4"},"principal":{"name":"4"},"roles":{"name":"4"}}}' \
-u apikey:$API_KEY \
-X POST 'http://192.168.1.21:8080/openproject/api/v3/memberships?' | jq .
Here is the answer:
{
"_type": "Error",
"errorIdentifier": "urn:openproject-org:api:v3:errors:InvalidRequestBody",
"message": "The request could not be parsed as JSON.",
"_embedded": {
"details": {
"parseError": "expected false () at line 1, column 2"
}
}
}
I do not understand the answer as my json is correct (validated by a json validator)
Can you give me a hint to resolve my issue ? (or an example)
I am using OpenProject 10.4.1
Thanks a lot
Kind regards
Xerviami