Skip to content

Using the data2paper api to create data papers

Anusha Ranganathan edited this page Mar 29, 2018 · 7 revisions

Try the data2paper API at demo.data2paper.org

  1. Register as a new user in the demo site

  2. Authenticate using the api and if successful you will be given a json web token

    POST to https://demo.data2paper.org/api/authenticate
    PARAMS: email and password
    

    If authenticated successfully will receive 200 OK and the body will contain the token

    {
    "auth_token": "some_long_jwt_auth_token_string_returned_on_successful_authentication"
    }
    

    Save the JSON web token to make all future requests with the data2paper API. You would need to get the token again, if you change your password.

  3. Add dataset to data2paper

    POST to https://demo.data2paper.org/api/data_paper
    PARAMS: doi and orcid
    Header: Authorization = JWT some_long_jwt_auth_token_string_returned_on_successful_authentication
    

    If the dataset was imported successfully to create a data paper, you should receive a 201 response with location header containing the url of the data paper record created. The body of the response has the metadata associated with the data paper

    Response: 201
    Header: location = http://demo.data2paper.org/concern/data_papers/79407x16z?locale=en
    

Now that you have added the data paper on behalf of the author, the author can login to data2paperusing their ORCID credentials, and view the data paper in the dashboard. Also, the URL of the data paper is in the location header of the response received in step 2.

Try API methods in Postman

An example postman collection is added to the docs to try these two commands in postman

Clone this wiki locally