Changes

stoney core: Resellers Resource - REST API

3,397 bytes added, 13:34, 11 December 2013
/* Reseller creation response message */
=== Reseller creation response message ===
{| class="wikitable sortable"
|-
! Status Line
! Content
! Example
 
|-
| Request lines
| <pre>HTTP/1.1 <HTTP-Status-Code> <HTTP-Status-Message></pre>
| <pre>HTTP/1.1 201 Created</pre>
 
|-
| Response headers
| <code>Accept: <Type>/<Subtype>
Content-Type: <Type>/<Subtype>
</code>
| | <code>Accept: application/json
Content-Type: application/json
</code>
 
|-
| [[#Reseller_creation_response_message_body|Response body]]
| JSON object
| <code>{ ... }</code>
 
|}
 
==== Reseller creation request message body ====
{| class="wikitable sortable" id="reseller_object"
|-
|+ align="top" style="text-align:left;"|Reseller Object
! Parameter name
! Data type
! Mandatory
! Description
! Allowed content
! Default value
! Example
 
|-
|<code>isCompany</code>
|boolean
|yes
|<code>true</code> if the reseller represents a company, <code>false</code> if it's an individual person.
|<code>true</code> or <code>false</code>
|
|<pre>isCompany: true</pre>
 
|-
|[[#billingAddress_object|<code>billingAddress</code>]]
|object
|yes
|An object holding the billing address informations for the given reseller. Refere to the [[#billingAddress_object|billingAddress object table]] for more informations.
|
|
|<pre>
"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/"
}
</pre>
 
|}
 
{| class="wikitable sortable" id="billingAddress_object"
|-
|+ align="top" style="text-align:left;"|billingAddress Object
!Parameter name
!Data type
!Mandatory
!Description
!Allowed content
!Default value
!Example
 
|-
|<code>organizationName</code>
|string
|no
|The name of the organization.
|@TODO: Add regex
|
|<pre>"organizationName": "Reseller Ltd."</pre>
 
|-
|<code>gender</code>
|string
|yes
|The gender of the address holder
|Either <code>f</code> for female, <code>m</code> for male or <code>n</code> for neutral.
|
|<pre>"gender": "f"</pre>
 
|-
|<code>givenName</code>
|string
|yes
|The given name (first name or forename) of the address holder.
|@TODO: Add regex
|
|<pre>"givenName": "Name"</pre>
 
|-
|<code>surname</code>
|string
|yes
|The surname (last name or family name) of the address holder.
|@TODO: Add regex
|
|<pre>"surname": "Surname"</pre>
 
|-
|<code>postalAddress</code>
|string
|yes
|
|@TODO: Add regex
|
|<pre>"postalAddress": ""</pre>
 
|-
|<code>countryCode</code>
|string
|yes
|
|@TODO: Add regex
|
|<pre>"countryCode": ""</pre>
 
|-
|<code>postalCode</code>
|string
|yes
|
|@TODO: Add regex
|
|<pre>"postalCode": ""</pre>
 
|-
|<code>localityName</code>
|string
|yes
|
|@TODO: Add regex
|
|<pre>"localityName": ""</pre>
 
|-
|<code>preferredLanguage</code>
|string
|yes
|
|@TODO: Add regex
|
|<pre>"preferredLanguage": ""</pre>
 
|-
|<code>mail</code>
|string
|yes
|
|@TODO: Add regex
|
|<pre>"mail": ""</pre>
 
|-
|<code>telephoneNumber</code>
|string
|yes
|
|@TODO: Add regex
|
|<pre>"telephoneNumber": ""</pre>
 
|-
|<code>mobileTelephoneNumber</code>
|string
|yes
|
|@TODO: Add regex
|
|<pre>"mobileTelephoneNumber": ""</pre>
 
|-
|<code>websiteURL</code>
|string
|yes
|
|@TODO: Add regex
|
|<pre>"websiteURL": ""</pre>
 
|}
== Reseller retrieval (GET) ==
SLB
385
edits