Update a request

A verified researcher is able to update his requests as long as it is in the state of concept or revision. Updating will update the active request revision.

{info} Only a researcher can update his requests


Method Uri Auth Role
PUT /v1/requests/{UUID} |Bearer JWT-Token|researcher`

Headers

The API requires a header Accept to be submitted with the request:

{
    "Accept": "application/json",
    "Authorization": "Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3M..." 
}

Data constraints (fillable)

{
    "title": "text",
    "coauthors": "array[text]",
    "author": "json,text",
    "has_informed_coauthors": "boolean",
    "has_agreed_terms": "boolean",
    "is_student": "boolean",
    "student_details": "text",
    "hypotheses": "text",
    "background": "text",
    "design": "text",
    "analyses": "text",
    "timeline": "text",
    "collection_id": "text"
}

Success Responses

Condition : User must be a researcher.

Code : 200 Okay

Content example : Response will reflect back the created request. The request is the active request which is the latest created revision of the request.

{
  "id": "01e1d8ae-6826-4d63-abd8-4b965177f7c4",
  "request": {
    "id": "50b17bb5-9270-4bfd-8f44-8206960c1bcb",
    "title": "Hello Sunshine Exposure generation",
    "author": {
      "firstName": "Jeroen",
      "lastName": "Boumans",
      ...
    },
    "coauthors": [
      "Jan Janssen"
    ],
    "has_informed_coauthors": 0,
    "has_agreed_terms": 0,
    "is_student": 0,
    "student_details": null,
    "hypotheses": null,
    "background": null,
    "design": null,
    "analyses": null,
    "timeline": null,
    "variables": null,
    "collection": {
      "id": "113595c6-fa44-49ad-8db5-6118e8f812df",
      "user_id": "087016f4-b65c-41f1-972f-20d50bf6c783",
      "name": null,
      "created_at": "2021-03-17T15:27:51.000000Z",
      "updated_at": "2021-03-17T15:27:51.000000Z",
      "deleted_at": null
    }
  },
  "revisions": [
    {
      "id": "50b17bb5-9270-4bfd-8f44-8206960c1bcb",
      ...
    }
  ],
  "created_at": "2020-07-23T16:15:45.000000Z",
  "updated_at": "2020-07-23T16:15:45.000000Z"
}

Error Responses

Condition : If the current user does not have the role researcher attached.

Code : 403 Unauthorized

Content example :

{
  "message": "User does not have the right roles."
}