Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CC License support] Addingresponse to "rightsByQuestions" #129

Merged
merged 4 commits into from Jun 17, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
29 changes: 25 additions & 4 deletions submissioncclicenses.md
Expand Up @@ -115,11 +115,32 @@ Some licenses contain questions, e.g. standard retrieved from https://api.creati
The fields are questions to be answered when assigning the license

## Search CC License
**/api/config/submissioncclicenses/search/rightsByQuestions**
**/api/config/submissioncclicenseurls/search/rightsByQuestions**

This endpoint is used to obtain the final CC License URI after (optionally) providing answers for the given license.
The URI may differ depending on the answers that are provided, and answers are only required if the given license requires them.
To use this endpoint, you must first request information about a specific license using the `/api/config/submissioncclicenses/<:license-name>` endpoint above.

Parameters:
* license: the ID of the license (e.g. standard, publicdomain, …)
* answer_X: List of answers (e.g. answer_commercial=y&answer_derivatives=sa)
* license: the ID of the license. This identifier must be a license returned from the `/api/config/submissioncclicenses` endpoint (e.g. standard, publicdomain, …)
* answer_X: List of answers. X must be a valid field ID returned from `/api/config/submissioncclicenses/<:license-name>`, and the answer value must be a valid value ID for that field. (e.g. answer_commercial=y&answer_derivatives=sa)

If the combination of the license and the answers is valid, it will return the license URI.

If the combination of the license and the answers is valid, it will return the license URI (e.g. http://creativecommons.org/licenses/by-nc-sa/3.0/us/ or http://creativecommons.org/publicdomain/zero/1.0/)
```json
{
"url": "http://creativecommons.org/licenses/by-sa/3.0/us/",
"type": "submissioncclicenseUrl",
"_links": {
"self": {
"href": "https://dspace7-internal.atmire.com/server/api/config/submissioncclicenses/search/rightsByQuestions?license=standard&answer_commercial=y&answer_derivatives=sa"
}
}
}
```

Response codes:
* 200 OK - if the operation succeeded
* 400 Bad Request - If the answers provided aren't valid or if a required answer is missing
* 401 Unauthorized - if you are not logged in
* 404 Not found - if the provided license isn't valid