Skip to main content

cURL - API Sample Code

Abstract

cURL - API Sample Code

This section contains code samples for requesting concept schemes and to import project data.

Web Service Method: Request Concept Schemes of a Project

GET Request to Retrieve Concept Schemes of a Project

curl -u superadmin:poolparty -H "Content-Type: application/x-www-form-urlencoded" -X GET "http://performance.semantic-web.at/PoolParty/api/thesaurus/1DDF8B20-104E-0001-1822-1C101D1A19C6/schemes"

Response

[ {
  "uri" : "http://thesaurus.sample.org/thesaurus/Countries",
  "title" : "Countries"
}, {
  "uri" : "http://thesaurus.sample.org/thesaurus/Departments",
  "title" : "Departments"
}, {
  "uri" : "http://thesaurus.sample.org/thesaurus/Regions",
  "title" : "Regions"
}, {
  "uri" : "http://thesaurus.sample.org/thesaurus/Topics",
  "title" : "Topics"
}, {
  "uri" : "http://thesaurus.sample.org/thesaurus/Institutions",
  "title" : "Institutions"
} ]

Web Service Method: Create a Project Using PPAR

curl -u superadmin:poolparty -H "content-type: multipart/form-data" -H "Content-Type: application/x-www-form-urlencoded" -F 'file=@pp_project_cocktails-project.ppar' -X POST https://test-nextrelease.semantic-web.at/PoolParty/api/projects/create

Web Service Method: Import Project Data

Import project data as file in trig format

curl -u superadmin:poolparty -X POST -H "Content-Type: application/trig" --data-binary @MyPoolPartyProject~1DF125DC-B37A-0001-FE7B-E546187E1790~20170125153640896~system.trig "https://darwin.poolparty.biz/PoolParty/api/projects/1DF14216-FAE8-0001-F9CB-561015371BE8/import?overwrite=true"