getServices
A Graze API GET request that returns a list of the services in the database.
Back to Graze API EndPoint Reference.
Request arguments
Endpoint getServices
takes the following request arguments:
Name | Type | Required | Description |
---|---|---|---|
| String | Yes | A valid |
| Integer | No | Maximum number of services to return. Defaults to 1,000. |
| Integer | No | Number of the first service to return. Defaults to 0. |
| String | Yes | A substring match where the service name contains the query string. |
| Boolean | No | If |
Response
Endpoint getServices
returns the following response:
Successful requests return an array of JSON objects containing the following:
Name | Type | Description |
---|---|---|
| Number | ID of the service. |
| String | Service name. |
| String | Description of the service. |
Examples
The following examples demonstrate typical use of endpoint getServices
:
Example using exact matching
Example cURL request using exact matching of the query "Network LON":
curl -G -u graze:graze -k -v "https://localhost/graze/v1/getServices" \ --data-urlencode 'query=Network LON' \ --data-urlencode 'exact_match=true'
Example response returning details of the service name "Network LON":
[{ "service_id":3, "name":"Network LON", "description":"Network description" }]
Example using approximate matching
Example cURL request using approximate matching of the query "Network":
curl -G -u graze:graze -k -v "https://localhost/graze/v1/getServices" --data-urlencode 'query=Network'
Example response returning details of all service names containing "Network":
[{ "service_id":1, "name":"Network LON", "description":"Network London" },{ "service_id":2, "name":"NY Network A", "description":"Network New York A" },{ "service_id":3, "name":"NY Network B", "description":"Network New York B" }]