You are viewing an old version of this page. View the current version.
Compare with Current
View Page History
« Previous
Version 9
Next »
Resources
get |
---|
URL | /api/v1/api.php?target=resource&action=get |
Description | Get a resource or resources |
Returns | Examples: SUCCESSFUL: {"success":1,"message":"Search successful","data":[{"id":"57","name":"2nd Email","slug":"6c-contact-email2","type":"field","parent_id":"1","category_id":null,"attr":[]}]} ERROR: {"success":0,"message":"Search failed"} |
Optional Parameters | Name | Type | Notes/Example |
---|
name | STRING | Name of the resource. Example: 6Connect, Inc. | slug | STRING | The unique URL friendly name of the resource. Example: 6connect-inc | type | STRING | Type of resource (eg. entry, field, category) |
At most, one of the following: Name | Type | Notes/Example |
---|
id | INTEGER | Get the resource which has this ID | resource__in | ARRAY | Get any resource which has any of these IDs | resource__not_in | ARRAY | Get all the resources which do not have any of these IDs |
At most, one of the following: Name | Type | Notes/Example |
---|
parent_id | INTEGER | Get the resources whose parent has this ID | parent__in | ARRAY | Get any resource whose parents have any of these IDs | parent__not_in | ARRAY | Get all resources whose parents do not have any of these IDs |
At most, one of the following: Name | Type | Notes/Example |
---|
category_id | INTEGER | Get the resources of the category that has this ID | category__in | ARRAY | Get the resources of the categories that have any of these IDs | category__not_in | ARRAY | Get the resources of all the categories that do not have any of these IDs |
You can set the order of the results by setting the STRING value of the parameter orderby to one of the following : - none
- id
- name (default)
- slug
- type
- parent_id
- date
- resource__in (preserve order given in the resource__in array)
You can set the direction of the ordering of the results by setting the STRING value of the parameter order to one of the following : You can further limit the results based on attributes the resources may have: Name | Type | Notes/Example |
---|
attr_key | STRING | The name of the attribute. Example: network-fqdn | attr_value | STRING | The value of any attribute, or if attr_key is specified, the value of the attribute defined in attr_key. | attr_compare | STRING | If both attr_key and attr_value are given, the results are by default compared based on the value given as attr_value being equal to the value stored in the database. You can optionally change this by setting the STRING value of attr_compare to one of the following: - = (default)
- !=
- ﹥
- ﹥=
- ﹤
- ﹤=
- LIKE
- NOT LIKE
- IN
- NOT IN
- BETWEEN
- NOT BETWEEN
- NOT EXISTS
|
|
Example URL | /api/v1/api.php?target=resource&action=get&id=7 |