Changes between Version 2 and Version 3 of DownscalingPortal/RESTfulAPI/Climate4Impact


Ignore:
Timestamp:
Mar 24, 2014 10:41:50 AM (8 years ago)
Author:
vegasm
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • DownscalingPortal/RESTfulAPI/Climate4Impact

    v2 v3  
    55== Access the API ==
    66
    7 Climate4Impact has an existing account into the Downscaling Portal. With the credentials provided is very simple to authenticate and get the token
     7Climate4Impact has an existing account into the Downscaling Portal. With the credentials provided is very simple to authenticate and get the token.
     8
     9{{{
     10curl -i -X POST -d username=your_username -d password=your_password http://meteo.unican.es/dp/rest/authenticate
     11}}}
     12
     13Success
     14
     15{{{
     16HTTP/1.1 201 Created
     17Date: Mon, 24 Mar 2014 08:59:04 GMT
     18token: your_token
     19Content-Length: 0
     20Content-Type: text/plain
     21}}}
    822
    923== User Administration ==
     
    1529=== 1. Create a new user ===
    1630
    17 {{{curl -i -H "Accept: application/json" -H "Content-type: application/json" -H "token: your_token" -X POST -d "{\"username\": \"pcmdi9.llnl.gov.openid.vegasm\", \"email\": \"vegasm@unican.es\", \"openID\": \"https://pcmdi9.llnl.gov/openid/vegasm\"}" http://meteo.unican.es/dp/rest/users}}}
     31{{{
     32curl -i -H "Accept: application/json" -H "Content-type: application/json" -H "token: your_token" -X POST -d "{\"username\": \"pcmdi9.llnl.gov.openid.vegasm\", \"email\": \"vegasm@unican.es\", \"openID\": \"https://pcmdi9.llnl.gov/openid/vegasm\"}" http://meteo.unican.es/dp/rest/users
     33}}}
    1834
    1935Response
    2036
    21 {{{HTTP/1.1 201 Created
     37{{{
     38HTTP/1.1 201 Created
    2239Date: Mon, 24 Mar 2014 09:08:17 GMT
    2340Content-Length: 0
    24 Content-Type: text/plain}}}
     41Content-Type: text/plain
     42}}}
    2543
     44If the request generates an exception or something is missing, an error will be shown.
     45Note: In some cases, it is possible that the character " has not to be escaped.
    2646
     47== List users ==
     48
     49{{{
     50curl -i -H "token: your_token" http://meteo.unican.es/dp/rest/users
     51}}}
     52
     53Success
     54
     55{{{
     56HTTP/1.1 200 OK
     57Date: Mon, 24 Mar 2014 08:59:48 GMT
     58Content-Type: application/json;charset=UTF-8
     59Transfer-Encoding: chunked
     60
     61{"responseCode":"success","message":"List of users retrieved","values":[{"username":"pcmdi9.llnl.gov.openid.vegasm","password":null,"email":"vegasm@unican.es","openID":"pcmdi9.llnl.gov.openid.vegasm"}]}
     62}}}
     63
     64== Remove user ==
     65
     66{{{
     67curl -i -H "Accept: application/json" -H "Content-type: application/json" -H "token: your_token" -X DELETE http://meteo.unican.es/dp/rest/users/pcmdi9.llnl.gov.openid.vegasm
     68}}}
     69
     70Success
     71{{{
     72HTTP/1.1 200 OK
     73Date: Mon, 24 Mar 2014 09:00:59 GMT
     74Content-Length: 0
     75Content-Type: text/plain
     76}}}