wiki:SoftwareDevelopment/EPIC/APIv2

Version 10 (modified by Twan Goosen, 10 years ago) (diff)

--

EPIC API v2

Test account

Production environment

Prefix 11372

Documentation

Usage examples

Taken from http://epic.gwdg.de/wiki/index.php/EPIC:API:v2:contribution:

The current PID-Service requires HTTP BASIC AUTH authentication, use the -u parameter.

VIEW

  • VIEW the PID 11022/1234-5678-1234-C in HTML format:
    curl -u 'tkalman:MyPaSsWoRd' http://pid.gwdg.de/handles/11022/1234-5678-1234-C
    
  • VIEW the PID 11022/1234-5678-1234-C in JSON format (Accept: header):
    curl -u 'tkalman:MyPaSsWoRd' -H "Accept:application/json" http://pid.gwdg.de/handles/11022/1234-5678-1234-C
    

(Note the Accept:application/json header.)

CREATE

  • Creating a PID for the URL "http://www.gwdg.de/TEST/abcdef":
    curl -u 'tkalman:MyPaSsWoRd' -H "Accept:application/json" -H "Content-Type:application/json" '''-X POST''' --data ''''[{"type":"URL","parsed_data":"http://www.gwdg.de/TEST/abcdef"}]'''' http://pid.gwdg.de/handles/11022/
    

UPDATE

  • Updating the PID 11022/1234-5678-1234-C:

Use the PUT method to update the Handle 11022/1234-5678-1234-C:

curl -u 'tkalman:MyPaSsWoRd' -H "Accept:application/json" -H "Content-Type:application/json" -X '''PUT''' --data '[{"type":"URL","parsed_data":"http://www.gwdg.de/TEST/newurl"}]' http://pid.gwdg.de/handles/'''11022/1234-5678-1234-C''