Resources
Warning |
---|
ProVision's APIv1 system has been replaced by APIv2, and is now considered deprecated. |
Table of Contents |
---|
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 |
HTML |
---|
<div id="google_translate_element"></div>
<script type="text/javascript">
function googleTranslateElementInit() {
new google.translate.TranslateElement({pageLanguage: 'en'}, 'google_translate_element');
}
</script>
<script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script> |
Table of Contents |
---|
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 | General Parameters:
Limit Results by ID: At most, one of the following:
At most, one of the following: |
| 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) |
Get the resources whose parent has this ID | ||
parent__in | ARRAY | Get any resource whose parents have any of these IDs. Syntax: &parent__in[]=162&parent__in[]=299 (Each parent id you wish to search over gets its own phrase.) |
parent__not_in | ARRAY | Get all resources whose parents do not have any of these IDs Syntax: &parent__not_in[]=1771&parent__not_in[]=14238 (Each parent id you wish to exclude gets its own phrase.) |
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 any resources whose categories have any of these IDs. Syntax: &category__in[]=11002&category__in[]=11003 (Each category id you wish to search over gets its own phrase.) |
category__not |
_in | ARRAY | Get |
the resources of all the categories that do not have any of these IDs Syntax: & |
parent__not_in[]= |
11002& |
parent__not_in[]= |
11003 (Each |
category id you wish to |
exclude gets its own phrase.) |
Limit Results by Resource Link:
For resources for which exist a Resource Link, you may limit by resource link data:
Name | Type | Notes/Example |
---|---|---|
resource_ |
Get all the resources which do not have any of these IDs
Syntax: &resource__not_in[]=1771&resource__not_in[]=14238 (Each resource id you wish to exclude gets its own phrase.)
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. Syntax: &parent__in[]=162&parent__in[]=299 (Each parent id you wish to search over gets its own phrase.) |
parent__not_in | ARRAY | Get all resources whose parents do not have any of these IDs Syntax: &parent__not_in[]=1771&parent__not_in[]=14238 (Each parent id you wish to exclude gets its own phrase.) |
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 any resources whose categories have any of these IDs. Syntax: &category__in[]=11002&category__in[]=11003 (Each category id you wish to search over gets its own phrase.) |
category__not_in | ARRAY | Get the resources of all the categories that do not have any of these IDs Syntax: &parent__not_in[]=11002&parent__not_in[]=11003 (Each category id you wish to exclude gets its own phrase.) |
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 :
- ASC (default)
- DESC
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:
|
Note |
---|
When attr_compare is set to IN, NOT IN, BETWEEN, NOT BETWEEN, then attr_value must either be an array or a comma separated string. |
You can search on multiple attributes by including an array of attribute options:
Name | Type | Notes/Example |
---|---|---|
attributes | ARRAY | var data = { "type: "entry", "attributes": [ { "attr_key": "_section", "attr_value": "105", }, { "attr_key": "address-mail-state", "attr_value": "CA", } ], "resources_per_page: 10 } |
link_type | STRING | The resource linkage relation name. Valid values include: For type = dnsmodule:
| ||||||||||||||
resource_link_column | INTEGER | The column to be used for the parameter in "resource_link_value". Valid integer values are: '1' = to use resource1 in the first column '2' = to use resource2 in the second column | ||||||||||||||
resource_link_value | INTEGER | The resource id for the resource_linkage table to search (Example: "10697") |
Limit Results by Attributes:
You can further limit the results based on attributes the resources may have:
Name | Type | Notes/Example | ||
---|---|---|---|---|
attributes | ARRAY | You can search on multiple attributes by including an array of attribute options: var data = { "type: "entry", "attributes": [ { "attr_key": "_section", "attr_value": "105", }, { "attr_key": "address-mail-state", "attr_value": "CA", } ], "resources_per_page: 10 } | ||
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:
| ||
attr_load | BOOL | Load resource attributes along with the resource entry |
Result Ordering:
Name | Type | Notes/Example |
---|---|---|
order | STRING | Set the direction of the ordering of the results by ascending or descending order. Valid values are:
|
orderby | STRING | The parameter to order results by. Valid values include:
|
Range Selection / Paging:
You can restrict the range of the resources returned.
Name | Type | Notes/Example |
---|---|---|
resources_per_page | INTEGER | How many resources to return per page, e.g.: '10' . |
offset | INTEGER | How many resources to offset from the initial resource, to use as the first resource provided in the return list (the initial resource is 0, not 1). |
paged | INTEGER | The page to return (starts at 1, not 0). This parameter is provided for convenience and is used to calculate the offset where: offset=(paged-1)*resources_per_page |
...
update | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
URL | /api/v1/api.php?target=resource&action=update | |||||||||
Description | Update a resource. | |||||||||
Returns | Examples: ERROR: {"success":0,"message":"No resource found with ID: 1079"} | |||||||||
Required Parameters |
| |||||||||
Optional Parameters (meta[type] = entry) |
| |||||||||
Optional Parameters (meta[type] = section) |
|
delete | |||||||||
---|---|---|---|---|---|---|---|---|---|
URL | /api/v1/api.php?target=resource&action=delete | ||||||||
Description | Delete a resource. | ||||||||
Returns | Examples: SUCCESSFUL: {"success":1,"message":"Resource deleted."} ERROR: {"success":0,"message":"No resource found with ID: 57"} | ||||||||
Required Parameters |
| ||||||||
Optional Parameters |
A recursive delete will delete all resources, which are permitted to be deleted, from the bottom up. Imagine the following hierarchy:
If a recursive delete is performed on A, but C21 is not deletable, the following resources would still be deleted: (B1, C11, C12, C22). B2 would not be deleted because it depends on C21 and A would not be deleted because it depends on B2. | ||||||||
Example URL | /api/v1/api.php?target=resource&action=delete&id=57 |
...
get resource search | ||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Description | Search the resource system for the provided term. Performs a "LIKE" search to return similar results. | |||||||||||||||||||||||||||||||||||||||||
URL | /api/v1/api.php?target=resource&action=get&search= | |||||||||||||||||||||||||||||||||||||||||
Returns | Examples:
Return Detail:
Required Attributes:
| |||||||||||||||||||||||||||||||||||||||||
Example URL | /api/v1/api.php?target=resource&action=get&search=6connect |
...