You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 7 Next »

Resources

get
URL/api/v1/api.php?target=resource&action=get
DescriptionGet a resource or resources
ReturnsExamples:
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
NameTypeNotes/Example
nameSTRINGName of the resource. Example: 6Connect, Inc.
slugSTRINGThe unique URL friendly name of the resource. Example: 6connect-inc
typeSTRINGType of resource (eg. entry, field, category)

 

At most, one of the following:

NameTypeNotes/Example
idINTEGERGet the resource which has this ID
resource__inARRAYGet the resources which has any of these IDs
resource__not_inARRAYGet all the resources which do not have any of these IDs

 

At most, one of the following:

NameTypeNotes/Example
parent_idINTEGERGet resources whose parent has this ID
parent__inARRAYGet resources whose parents have one of these IDs
parent__not_inARRAYGet resources whose parents do not have one of these IDs

 

At most, one of the following:

NameTypeNotes/Example
category_idINTEGERGet resources of the category that has this ID
category__inARRAYGet resources of the categories that have one of these IDs
category__not_inARRAYGet resources of the categories that do not have one 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 :

  • ASC (default)
  • DESC

 

 

Example URL/api/v1/api.php?target=resource&action=get&id=7
  • No labels