Adding record items on the sandbox using Postman or Curl

42 views
Skip to first unread message

Trevor Ohlinger

unread,
May 19, 2022, 6:11:51 PMMay 19
to ORCID API Users

Hello,


I've been working with the ORCID API and Postman. I'm trying to test writing to ORCID records on the sandbox before updating them in production.

I've followed the pseudo-code instructions outlined here: https://info.orcid.org/documentation/integration-and-api-faq/#easy-faq-2691 
I've been getting errors such as 400, and 403 Forbidden. So far nothing seems to be getting through to ORCID. 

Here's an example of what I get when I try to write to an employment record in the sandbox: 

0000-0003-4604-4108/employment?Content-type=application/vnd.orcid+json&Authorization Bearer=&access_token=532c1bc4-cdc9-4287-961a-d37e288ed3f8&Data=@C:\temp\bulkdata.json&URL=https://api.sandbox.orcid.org/v3.0/0000-0003-4604-4108/works
image.png

I've tried some variations that include my client secret, but the pseudo-code guide doesn't seem to require it. 

It seems the preferred method to work with the ORCID API is by using Curl. Is there a program that is utilized with Curl or is it just using the command line?
I'm at a loss for how to use Postman or Curl to update ORCID records.

Here are my results in Curl: 

C:\Users\trevorohlinger>curl -i -H 'Content-type: application/vnd.orcid+json' -H 'Authorization: Bearer 532c1bc4-cdc9-4287-961a-d37e288ed3f8' -d '@C:\temp\bulkdata.json' -X POST 'https://api.sandbox.orcid.org/v3.0/0000-0003-4604-4108/employment'

curl: (6) Could not resolve host: application
curl: (6) Could not resolve host: Bearer
curl: (6) Could not resolve host: 532c1bc4-cdc9-4287-961a-d37e288ed3f8'
curl: (3) URL using bad/illegal format or missing URL


Perhaps I should be using XML over JSON? Any guidance on how to update users' information would be greatly appreciated.

Thanks,
Trevor
--

Trevor Ohlinger
Systems Administrator I

Albertsons Library Boise State University


Phone: (208) 426-2311
Email: trevoro...@boisestate.edu
Mail: 1865 W Cesar Chavez Ln, Boise, ID 83725-1030
Location: Library 208-C, Boise, ID 83706
Web: giving.boisestate.edu  |  alumni.boisestate.edu


Make a gift to Albertsons Library today!

d.pa...@orcid.org

unread,
May 26, 2022, 8:37:14 PMMay 26
to ORCID API Users
Hi Trevor!

It looks like you are trying to run the curl command on a Windows Terminal and that's why you are having that issue.
A solution could be to use Git Bash or Ubuntu Terminal instead.
Or if you want to continue using the Windows Terminal your curl command should look like this:

curl -i -H "Content-type: application/vnd.orcid+json" -H "Authorization: Bearer 532c1bc4-cdc9-4287-961a-d37e288ed3f8" -d "@C:\temp\bulkdata.json" -X POST "https://api.sandbox.orcid.org/v3.0/0000-0003-4604-4108/employment"

I replaced the single quotes with double quotes.

And also it looks like you are using bulk-work-3.0.json file and the correct endpoint is `{{ORCID}}/works` instead of `{{ORCID}}/employment`.

We also have Postman documentation that you can check with some examples.

Best Regards.
Reply all
Reply to author
Forward
0 new messages