Changes

stoney core: Search Resource - REST API

3,471 bytes added, 10:51, 3 August 2014
/* Overview */
** Default: 5
** Maximum: 15 (can be raised by '''entries''' get parameter)
* The attributes returned for each individual resource are presently the same as when querying the corresponding resource collection.
= stoney core: search resource methods =
== Global Search (GET) ==
Also visit [[stoney core: Search Resource Mapping (REST - LDAP)]] and [[stoney core: Global Searches]].
 
To form a global fulltext search (over all resources), append the url query parameter '''q''' with the desired search text: <code>https://api.example.com/v1/search?q=example</code>.
|-
|
|arrayôbject
|no
|An object containing an array with one or more resource collection objects. See [[stoney_core:_Resellers_Resource_-_REST_API#reseller_collection_array_element_object | Reseller Collection Array Element Object]] for a concrete example.
|
|
"isCompany": true,
"isActive": true,
"resellerName": "Example Reseller Ltd", "countryCode": "CH", "postalCode": "3012", "localityName": "Bern"
},
{ "id": 4000001,
"isCompany": true,
"isActive": true,
"resellerName": "Example Reseller No 2 Ltd", "countryCode": "CH", "postalCode": "8004", "localityName": "Zürich"
}
],
"isCompany": true,
"isActive": true,
"customerName": "Example Customer Ltd" "countryCode": "CH", "postalCode": "3012", "localityName": "Bern", "belongsToResellerID": 4000000
},
{ "id": 5000001, "location": "https://api.example.. com/v1/customers/5000001", "isCompany": false, "isActive": true, "customerName": "Peter Example" "countryCode": "CH", "postalCode": "3012", "localityName": "Bern", "belongsToResellerID": 4000001 }
],
"location": "https://api.example.com/v1/customers/?q=example"
},
"people":
{
"resources":
[
{ "id": 6000000,
"location": "https://api.example.com/v1/people/6000000",
"isActive": true,
"givenName": "Peter",
"surname": "Example"
"customerName": "Example Customer Ltd",
"belongsToResellerID": 4000000,
"belongsToCustomerID": 5000000
},
{ "id": 6000001,
"location": "https://api.example.com/v1/people/6000001",
"isActive": true,
"givenName": "Thomas",
"surname": "Example"
"customerName": "Example Customer Ltd",
"belongsToResellerID": 4000000,
"belongsToCustomerID": 5000000
},
],
"location": "https://api.example.com/v1/people/?q=example"
},
...
|}
== Global Search Response Object (stoney core: Resellers Resource) ==
The logic is described on the [[stoney core: Search Resource Mapping (REST - LDAP)]] page under the chapter [[stoney_core:_Search_Resource_Mapping_(REST_-_LDAP)#Global_Search_Response_Object_.28stoney_core:_Resellers_Resource.29 | Global Search Response Object (stoney core: Resellers Resource)]].
Resource collection object for the stoney core: Resellers Resource.
<source lang='javascript'>
"resellers":
{
"resources":
[
{ "id": 4000000,
"location": "https://api.example.com/v1/resellers/4000000",
"isCompany": true,
"isActive": true,
"resellerName": "Example Reseller Ltd",
"countryCode": "CH",
"postalCode": "3012",
"localityName": "Bern"
},
{ "id": 4000001,
"location": "https://api.example.com/v1/resellers/4000001",
"isCompany": true,
"isActive": true,
"resellerName": "Example Reseller No 2 Ltd",
"countryCode": "CH",
"postalCode": "8004",
"localityName": "Zürich"
}
],
"location": "https://api.example.com/v1/resellers/?q=example"
},
</source>
{| class="wikitable sortable" style="widthGlobal Search Response Object (stoney core: 100%;" idCustomers Resource) =="reseller_collection_array_element_object"|The logic is described on the [[stoney core: Search Resource Mapping (REST -|+ align="top" style="textLDAP)]] page under the chapter [[stoney_core:_Search_Resource_Mapping_(REST_-align_LDAP)#Global_Search_Response_Object_.28stoney_core:left;"_Customers_Resource.29 |Reseller Collection Array Element Global Search Response Object!Parameter name!Data type!Mandatory!Description!Valid content![http(stoney core://wwwCustomers Resource)]].pcre.org/ PCRE]!Default value!Example
|-Resource collection object for the stoney core: Customers Resource.|<codesource lang='javascript'> "customers": { "resources": [ { "id<": 5000000, "location": "https:/code>/api.example.com/v1/customers/5000000",|integer "isCompany": true,|yes "isActive": true,|The identification number of the reseller. "customerName": "Example Customer Ltd" | "countryCode": "CH",|@TODO add regex "postalCode": "3012",| "localityName": "Bern",|<source lang= "javascriptbelongsToResellerID">: 4000000 }, { "id": 40000005000001, "location": "https://api.example.com/v1/customers/5000001", "isCompany": false, "isActive": true, "customerName": "Peter Example" "countryCode": "CH", "postalCode": "3012", "localityName": "Bern", "belongsToResellerID": 4000001 } ], "location": "https://api.example.com/v1/customers/?q=example" },</source>
|-|<code>location</code>|string|yes|The location URI of the reseller resource.|@TODO add link to URI RFC |||<source lang="javascript">"location": "https://api.example.com/v1/resellers/4000000"</source> |-|<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>|||<source lang="javascript">"isCompany"Global Search Response Object (stoney core: true</source> |-|<code>isActive</code>|boolean|yes||<code>true</code> or <code>false</code>||<code>true</code>|<source langPeople Resource) =="javascript">"isActive": true</source> |-|<code>resellerName</code>|string|yes|The reseller's display name. Mostly the same as the <code>organizationName</code> or the <code>givenName</code> and <code>surname</code> out of logic is described on the [[#billingAddress_object|billingAddress objectstoney core: Search Resource Mapping (REST - LDAP)]], but can also be page under the name of a brandchapter [[stoney_core:_Search_Resource_Mapping_(REST_-_LDAP)#Global_Search_Response_Object_.||||<source lang="javascript">"resellerName"28stoney_core: "Super-duper Hosting"</source> _People_Resource.29 |} == Resellers Global Search Response Object (GET) == == Customers Search (GET) == == stoney core: People Search (GETResource) ==]].
Resource collection object for the stoney core: People Resource.
<source lang='javascript'>
"people":
{
"resources":
[
{ "id": 6000000,
"location": "https://api.example.com/v1/people/6000000",
"isActive": true,
"givenName": "Peter",
"surname": "Example"
"customerName": "Example Customer Ltd",
"belongsToResellerID": 4000000,
"belongsToCustomerID": 5000000
},
{ "id": 6000001,
"location": "https://api.example.com/v1/people/6000001",
"isActive": true,
"givenName": "Thomas",
"surname": "Example"
"customerName": "Example Customer Ltd",
"belongsToResellerID": 4000000,
"belongsToCustomerID": 5000000
},
],
"location": "https://api.example.com/v1/people/?q=example"
},
</source>
[[Category: REST API]][[Category:stoney core]]
SLB, editor, reviewer
3,368
edits