Web Service:PR-WS-5: Difference between revisions

From IHRIS Wiki
No edit summary
No edit summary
Line 16: Line 16:
  |response=HTTP 200 - OK
  |response=HTTP 200 - OK
*If ${repsformat} is 'http' the HTTP response body will contain the epid as plain text of the newly created provider.  
*If ${repsformat} is 'http' the HTTP response body will contain the epid as plain text of the newly created provider.  
*If ${respformat} is 'json' it will contain a JSON object with the field 'epid' of the newly created provider as well as the URLs to access for further web-service actions to perform on the provider.  Example:
*If ${respformat} is 'json' it will contain a JSON object with the field 'epid' of the newly created provider as well as the URLs to access for further web-service actions to perform on the provider.   
{
{
     "epid": 211312,
     "epid": 211312,
     actions: {
     actions: {
       "providerDetails": 'http:://rhea.ihris.org/providerDetails?epid=211312',
       "providerDetails": 'http://rhea-pr.ihris.org/providerDetails?epid=211312',
       "editProvider": 'http:://rhea.ihris.org/editProvider?epid=211312',
       "editProvider": 'http://rhea-pr.ihris.org/editProvider?epid=211312',
       "addPost": 'http:://rhea.ihris.org/addPost?epid=211312',
       "addPost": 'http://rhea-pr.ihris.org/addPost?epid=211312',
       "postDetails": 'http:://rhea.ihris.org/postDetails?epid=211312',
       "postDetails": 'http://rhea-pr.ihris.org/postDetails?epid=211312',
      "viewProvider": 'http://rhea-pr.ihris.org/providerregistry/view?id=person|23123'
     }  
     }  
}
}

Revision as of 14:03, 30 October 2012

Web Service: PR-WS-5 Add a Provider


Add Provider Details

URL /ws/rest/v2/addProvider
GET Parameters The following webservice should accept the following parameters:
  • ${firstname} The first name of the provider. Required.
  • ${surname} The surname of the provider. Required.
  • ${nationality} The nationality of the provider coded according to ISO-3166-1 alpha-3. Required.
  • ${nid} The national id. Required.
  • ${passport} The passport number. Optional.
  • ${mutuelle} The mutuelle number. Optional.
  • ${csr} The CSR number. Optional.
  • ${respformat} Describes response format. Optional. Default is 'http', can also be 'json.'
GET Response HTTP 200 - OK
  • If ${repsformat} is 'http' the HTTP response body will contain the epid as plain text of the newly created provider.
  • If ${respformat} is 'json' it will contain a JSON object with the field 'epid' of the newly created provider as well as the URLs to access for further web-service actions to perform on the provider.

{

    "epid": 211312,
    actions: {
      "providerDetails": 'http://rhea-pr.ihris.org/providerDetails?epid=211312',
      "editProvider": 'http://rhea-pr.ihris.org/editProvider?epid=211312',
      "addPost": 'http://rhea-pr.ihris.org/addPost?epid=211312',
      "postDetails": 'http://rhea-pr.ihris.org/postDetails?epid=211312',
"viewProvider": 'http://rhea-pr.ihris.org/providerregistry/view?id=person
GET Error
  • HTTP 500 - Server Error - If the server encountered an error.
  • HTTP 400 - Bad Request - If the parameters are malformed.
GET Example /ws/rest/v2/addProvider/?firstname=Bill&surname=Smith&nationality=RW&nid=12312342

Other Resources: Use Case:PR-WS-5