Changes

Jump to: navigation, search

stoney core: People Resource - REST API

62 bytes added, 08:55, 5 January 2015
/* Links */
Basically, we want to be able to do the following things:
* Create a new person ([[#Person_creation_.28POST.29|POST]]).* Retrieve multiple people in the form of a list ([[#People_collection_retrieval_.28GET.29|GET]]).* Retrieve a single person ([[#Person_element_retrieval_.28GET.29|GET]]).* Update an existing person ([[#Person_update_.28PUT.29|PUT]]).* Update one or more values of an existing person ([[#Person_partly_update_.28PATCH.29|PATCH]]).* Delete a single person ([[#Person_deletion_.28DELETE.29|DELETE]]).
To get an idea what happens behind the screens, have a look at the [[stoney core: People Resource Mapping (REST - LDAP)]] documentation located in the [[:Category:Mapping (REST - LDAP)|Mapping (REST - LDAP)]] category.
= People resource methods =
== Person creation (POST) ==
To create a new person the client needs to send a HTTP <code>POST</code> request on the people collection resource URI <code>https://api.example.com/v1/people</code> (also see [[Application_Programming_Interface_(API)#Base_URI|Base URI]]), including the associated person informationsinformation.
The service will generate a new person and responds with a HTTP status code <code>201</code> (Created) on success. The newly created person URI is returned within the HTTP location header, which can be used by the client to gather further information about the new person.
|object
|no
|In case of a failure, an error object with the appropriate error messages will be returned. Refer to the [[stoney_core:_REST_API#Error_codes_and_responses|Error codes and response chapter]] for more informationsinformation.
|
|
|object
|no
|In case of a failure, an error object with the appropriate error messages will be returned. Refer to the [[stoney_core:_REST_API#Error_codes_and_responses|Error codes and response chapter]] for more informationsinformation.
|
|
|integer
|yes
|The [[stoney_core:_Resellers_Resource_-_REST_API|reseller's]] identification number the customer resource must belong person belongs to.
|
|@TODO add regex
=== Person element retrieval (GET) ===
To retrieve an existing person and fetch the informations information associated with it, the client needs to send a HTTP <code>GET</code> request on the person's element resource URI (such as <code>https://api.example.com/v1/people/5000001</code>.The service responds with a HTTP status code 200 (OK) on success and returns the associated person informationsinformation.
==== Person element retrieval request message ====
|<source lang="javascript">"preferredLanguage": "de-CH"</source>
|-
|<code>password</code>
|string
|yes
|Password
|min 8 chars, max 255 chars
|
|
|<source lang="javascript">"password": "dontstealme!"</source>
|-
|object
|no
|In case of a failure, an error object with the appropriate error messages will be returned. Refer to the [[stoney_core:_REST_API#Error_codes_and_responses|Error codes and response chapter]] for more informationsinformation.
|
|
==== Person update response message body ====
On success (<code>200</code>) an empty response message body will be returned, otherwise an [[stoney_core:_REST_API#Error_codes_and_responses|error object]] will provide further informations information about the failure.
== Person partly update (PATCH) ==
==== Person partly update response message body ====
On success (<code>200</code>) an empty response message body will be returned, otherwise an [[stoney_core:_REST_API#Error_codes_and_responses|error object]] will provide further informations information about the failure.
== Person deletion (DELETE) ==
==== Person deletion response message body ====
On success (<code>200</code>) an empty response message body will be returned, otherwise an [[stoney_core:_REST_API#Error_codes_and_responses|error object]] will provide further informations information about the failure.
== People search ==
= Links =
* [[stoney core: REST API]]
 
Hello world!
[[Category:REST API]][[Category:stoney core]]
3,368
edits