Changes

stoney core: REST API

1,225 bytes added, 10:24, 14 November 2013
/* Reseller update (PUT) */
==== Reseller update (PUT) ====
Updates an existing Reseller, the <code>PUT</code> method requires one to sent the complete record, thus the work-flow is normally as follows:
# A [[#Reseller_retrieval_.28GET.29|GET]] request on the Reseller element URI will be made to fetch the whole document.
# Update the fields which content has changed
# Send a <code>PUT</code> request with all the reseller data
'''Request''':
<pre>
PUT /v1/resellers/12345678 HTTP 1.1
HOST: api.example.com
</pre>
<pre>
Accept: application/json
Content-Type: application/json
</pre>
<source lang='javascript'>
{
"id": 12345678
"isCompany": true,
"billingAddress":
{
"organizationName": "Reseller Ltd.",
"gender": 'm',
"givenName": "Name",
"surname": "Surname",
"postalAddress": "Street Number",
"countryCode": "CH",
"postalCode": "Postal Code",
"localityName": "Locality",
"preferredLanguage": "en-GB",
"mail": "name.surname@example.com",
"telephoneNumber": "+41 00 000 00 00",
"mobileTelephoneNumber": "+41 00 000 00 00",
"websiteURL": "https://www.example.com/"
}
}
</source>
 
'''Answer''':
<pre>
HTTP/1.1 200 OK
</pre>
<pre>
Content-Type: application/json; charset=UTF-8
</pre>
<source lang='javascript'>
</source>
 
==== Reseller partly update (PATCH) ====
SLB
385
edits