Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

https://montana.dev.eagle-i.net

IMPORTANT: use https and not http - there is a redirect in place from http to https, and many REST clients that follow redirects do not forward POSTed data.

Known issues:

  • error codes not properly handled
  • currently no ontology-level validation of externally-produced resource descriptions
  • currently does not handle links to referenced taxonomy terms  (as opposed to links to eagle-i resources). Example of record not handled due to the related technique field: http://montana.dev.eagle-i.net/i/0000012b-00be-dcdf-df3b-3fdc80000009
  • we currently do not enforce the association URI-foreign key (this will come)
  • DELETE is not yet implemented
  • This is not thoroughly tested

...

 /sweet/api/externalResource

Method:

POST 

Args:

Content-type:

application/json

Payload:

The exchangeInstance  -- the EIExchangeInstance JSON of the primary resource and secondary resources to be created/updated (no instance URI indicates that the resource should be created). Note that for updates, the API user must have claim permission over the resources (current user is hardcoded in the backend)

...

The POST service expects content to be passed as a multi-part form, with type=application/json set for the exchangeInstance part.JSON string, hence the Content-type HTTP header must be set to {{ application/json}}

REST clients should be able handle all of this  this out-of-the box.

Example GET CURL command, substitute your own credentials:

No Format
curl -v --get -v -u eagle-i-user:password -d uri=http://montana.dev.eagle-i.net/i/0000012f-989d-df6c-b822-788380000000 https://montana.dev.eagle-i.net/sweet/api/externalResource

Example POST CURL command, substitute your own credentials (assumes a valid json instance in the file json.txt):

No Format
cat json.txt | curl -v -X POST -u eagle-i-user:password  -F 'exchangeInstance=@-;type=application/json'H "Content-Type: application/json" -d @json.txt  https://montana.dev.eagle-i.net/sweet/api/externalResource

...