API entity search

From FreeDESK
Revision as of 19:02, 21 August 2012 by Dave (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
Entity Search
Call/Mode: entity_search
Description: Search an Entity
Parameters: entity, [fields], start, limit
Returned Data: XML login error or session data

This article details a FreeDESK API call.

Description

The entity_search call will search a registered entity (with valid permissions) and return matches

Using the Call

Pass in the following parameters using GET or POST

  • entity : Entity
  • start : Start (0 for beginning)
  • limit : Limit number of results (default 30)
  • [fields] : In the form of:
fieldname=value

For example

api.php?mode=entity_search&entity=customer&firstname=david

Would search the customer entity for records with the firstname of david (starting at the beginning and returning a max of 30 results)

Returned Data

XML containing search results on success or a API XML Error on failure.

Example returned output on success:

<search-results>
 <meta>
 <field-data>
  <id>customerid</id>
  <name>Customer ID</td>
 </field-data>
 <field-data>
  <id>firstname</id>
  <name>First Name</name>
 </field-data>
 <field-data>
  <id>lastname</id>
  <name>Last Name</name>
 </field-data>
 <keyfield>customerid</keyfield>
</meta>
<entity>
 <field id="customerid">1</field>
 <field id="firstname">David</field>
 <field id="lastname">Cutting</field>
</entity>
</search-results>
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox