Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
api [2012/08/07 00:17]
lisa [WorkXpress API Data Formats]
api [2012/08/07 21:31]
lisa [WorkXpress API Data Formats]
Line 42: Line 42:
  
 The URL for the WorkXpress WSDL is: The URL for the WorkXpress WSDL is:
 +
 http://​example.workxpress.com/​api/​api.php?​wsdl http://​example.workxpress.com/​api/​api.php?​wsdl
  
Line 50: Line 51:
 Example: Example:
  
-<WRAP center round box 60%>+<WRAP center round box 80%>
 $soap = new $soap = new
  
Line 74: Line 75:
 The build tools are not available on testing and production applications. However, this The build tools are not available on testing and production applications. However, this
 page can be accessed via page can be accessed via
 +
 http://​example.workxpress.com/​im_tools/​create_auth_key.php. http://​example.workxpress.com/​im_tools/​create_auth_key.php.
  
Line 101: Line 103:
 as you want, allowing you to combine many lookups into one call. as you want, allowing you to combine many lookups into one call.
    
-//​dataSet ​Attributes:// + 
-reference String An identifier that will be  +^DataSet ​Attributes ​^^^ 
-returned with the response to +|reference ​ ​| ​String ​An identifier that will be returned with the response to identify different data sets. |
-identify different data sets. +
  
 ** **
Line 114: Line 115:
 single item within the data set. single item within the data set.
  
-// +^Item Attributes ​^^^ 
-item Attributes://  +|itemId ​String ​The id of the item to lookup
-   +
-{class="​wikitable"​ +
-Orange +
-Apple +
-align="​right"​| 12,333.00 +
-|- +
-| Bread +
-| Pie +
-| align="​right"​| 500.00 +
-|- +
-| Butter +
-| Ice cream +
-| align="​right"​| 1.00 +
-|}+
  
 ** <​map></​map>​** - Contained inside of the items node, the map node contains the ** <​map></​map>​** - Contained inside of the items node, the map node contains the
Line 145: Line 133:
 single Field to retrieve data from.  single Field to retrieve data from. 
  
-//field Attributes:// +^field Attributes: ​^^^ 
-fieldId String Id of the Field. +|fieldId ​String ​Id of the Field.| 
-reference String An identifier that will be  +|reference ​String ​An identifier that will be returned with the response to identify each Field.
-returned with the response to +   
-identify each Field. ​+   
  
 **<​format></​format>​** - Contained inside of the field node, the format node defines ​ **<​format></​format>​** - Contained inside of the field node, the format node defines ​
Line 157: Line 145:
 parts at the end of this document. ​ parts at the end of this document. ​
  
-//format Attributes://  +^format Attributes: ​^^^ 
-type String There are three different +|type String ​| Id of the Field.| 
-options for the format of the +|reference | String | There are three different options for the format of the data:| 
-data: +| ::: | ::: |html – Includes any HTML used when rendering the noneditable Field inside of the WorkXpress Application.| 
- +| ::: | ::: |stored – The format of the Field as it is stored in the WorkXpress database.| 
-html – Includes any HTML used +| ::: | ::: |text – Returns the value as plain text.  This is the recommended format.|
-when rendering the noneditable +
-Field +
-inside +
-of +
-the +
- +
-WorkXpress +
-Application. +
- +
- +
- +
-stored +
- +
-The +
-format +
-of +
-the +
-Field +
- +
-as +
-it +
-is +
-stored +
-in +
-the +
- +
-WorkXpress +
-database. +
- +
- +
- +
-text +
- +
-Returns +
-the +
-value +
-as +
-plain +
- +
-text. +
- +
-This +
-is +
-the +
-recommended +
- +
-format.+
  
  
Line 219: Line 160:
 defines a single Relation to lookup. defines a single Relation to lookup.
  
-//relation Attributes://  +^relation Attributes: ​^^^ 
-relationType String Id of the Relation Type. +|relationType ​String ​Id of the Relation Type.| 
-from String Defines which side of the  +|from String ​Defines which side of the Relation to start from.  Valid values are:
-Relation to start from.  Valid +| ::: | ::: |base – The base side of the Relation Type.| 
-values are:+| ::: | ::: |target – The target side of the Relation Type. | 
 +|reference |String |An identifier that will be returned with the response to identify each Relation Type. |
  
-base – The base side of the 
-Relation Type. 
- 
-target – The target side of the 
-Relation Type.  
-reference String An identifier that will be 
-returned with the response to 
-identify each Relation Type.  
  
 **Response XML** - Below is a description of the valid nodes returned in the Response ​ **Response XML** - Below is a description of the valid nodes returned in the Response ​
Line 242: Line 176:
 callStatus node contains the status of the SOAP call. callStatus node contains the status of the SOAP call.
  
-//callStatus Attributes://  +^callStatus Attributes: ​^^^ 
-status String The call's status. ​ Values include +|status ​String ​The call's status. ​ Values include success and failure.
-success and failure. ​+  
 + 
  
 **<​compatibilityLevel></​compatibilityLevel>​** - Contained inside of the  **<​compatibilityLevel></​compatibilityLevel>​** - Contained inside of the 
Line 253: Line 188:
 returned for each data set in the request document. returned for each data set in the request document.
    
-//dataSet Attributes:// + 
-reference String The reference that was defined ​ +^dataSet Attributes: ​^^^ 
-for the data set in the request +|reference ​String ​The reference that was defined for the data set in the request document. ​
-document. ​+ 
  
 **<​item></​item>​** - Contained inside of the dataSet node, the item node identifies a  **<​item></​item>​** - Contained inside of the dataSet node, the item node identifies a 
 single item within the data set. single item within the data set.
  
-//item Attributes://  + 
-ItemId String The id of the current item.+^item Attributes: ​^^^ 
 +|ItemId ​String ​The id of the current item.  | 
    
 **<​field></​field>​** - Contained inside of the item or relation node, the field node **<​field></​field>​** - Contained inside of the item or relation node, the field node
 contains data about a single field on the current Item or Relation. ​ contains data about a single field on the current Item or Relation. ​
  
-//field Attributes://  +^field Attributes: ​^^^ 
-ItemId String Id of the Field. +|ItemId ​String ​Id of the Field. ​ | 
-reference String The reference that was defined ​ +|reference ​|String ​|The reference that was defined for the field in the request document. ​  | 
-for the field in the request +
-document. ​+
  
 **<​value></​value>​** - Contained inside of the field node, the value node holds the  **<​value></​value>​** - Contained inside of the field node, the value node holds the 
Line 279: Line 215:
 contains data about a single relationship from the current item.  contains data about a single relationship from the current item. 
  
-relation Attributes:​ +^relation Attributes: ​^^^ 
-reference String The reference that was  +|reference ​|String ​|The reference that was defined for the Relation Type in the request document.| ​ 
- +|id |String |Id of the current Relationship.| 
-orrespond  +|relationType |String |Relation Type id of the current Relationship.| 
- +|baseItemTypeId |String |Item Type id of the base Item.| 
- +|baseItemId |String |Id of the base Item.| 
- +|targetItemTypeId |String |Item Type id of the target Item.| 
- +|targetItemId |String |Id of the target Item.|
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
-  +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
- +
    
-defined for the Relation Type 
-in the request document. ​ 
-id String Id of the current Relationship. 
-relationType String Relation Type id of the  
-current Relationship. 
-baseItemTypeId String Item Type id of the base Item. 
-baseItemId String Id of the base Item. 
-targetItemTypeId String Item Type id of the target ​ 
-Item. 
-targetItemId String Id of the target Item.  
 **Examples:​** ​ **Examples:​** ​
 <WRAP center round box 80%> <WRAP center round box 80%>
 //An example of a basic LookupData Request might use the following XML:// //An example of a basic LookupData Request might use the following XML://
  
-<​wxRequest> ​+<​code>​<​wxRequest> ​
     <dataSet reference=”accounts”>​     <dataSet reference=”accounts”>​
         <​items>​         <​items>​
Line 368: Line 260:
         </​relations>​         </​relations>​
     </​dataSet> ​     </​dataSet> ​
-</​wxRequest>​+</​wxRequest></​code>
 </​WRAP>​ </​WRAP>​
  
-//​Corresponding response XML://+
    
-<WRAP center round box 80%> +<WRAP center round box 80%>//​Corresponding response XML:// 
-<​wxResponse>​+<​code>​<​wxResponse>​
     <​callStatus status=”success” />     <​callStatus status=”success” />
     <​compatibilityLevel>​1</​compatibilityLevel>​     <​compatibilityLevel>​1</​compatibilityLevel>​
Line 391: Line 283:
                 </​field>​                 </​field>​
             </​relation>​             </​relation>​
-        </​item> ​+        </item></​code
 </​WRAP>​ </​WRAP>​
 +
 +===== Function: AddItem =====
 + ​AddItem is a function for creating new Items inside of WorkXpress. ​ When adding
 +Items through the WorkXpress API, any appropriate Item, Field and Relation Actions
 +will be executed.
 + 
 +**Request XML** - Below is a description of the node types, their attributes and the valid
 +child node types supported for an AddItem request. ​
 +
 +**<​wxRequest></​wxRequest>​** - The root node for the Request XML document. ​
 +
 +**<​dataSet></​dataSet>​** - Contained inside of the wxRequest node , the dataSet node 
 +contains the information required for a item add request. ​ You may have as many data
 +sets as you want, allowing you to combine many add items requests into one call. 
 +
 +^dataSet Attributes: ^^^
 +|reference |String |An identifier that will be returned with the response to identify different data sets. |
 +
 +**<​item></​item>​** - Contained inside of the dataSet node, the item node contains the Item Type id of the Item being added.
 +
 +^item Attributes: ^^^
 +|itemTypeId |String |The Item Type id of the item being created. |
 +
 +**<​fields></​fields>​** - Contained inside of the dataSet and relation nodes, the fields ​
 +node is the parent node for the Fields to set on the Item or Relation previously defined.
 +
 +**<​field></​field>​** - Contained inside of the fields node, the field node defines a 
 +single Field to store data into.
 +
 +^field Attributes: ^^^
 +|fieldId |String |Id of the Field.|
 + 
 +**<​value></​value>​** - Contained inside of the field node, the value node holds the
 +value to store into the Field. ​
 +
 +**<​relations></​relations>​** - Contained inside of the dataSet node, the relations ​
 +node is the parent node for any Relationships that should be added when the Item is
 +added. ​
 +
 +**<​relation></​relation>​** - Contained inside of the relations node, the relation node
 +defines a single Relation to create. ​
 +
 +^relation Attributes:​^^^
 +|action |String |The action to perform on the Relationship. ​ This should be set to “add” when adding a Relationship. |
 +|oppositeItemId |String |The Item Id of the Item that you wish to relate the Item you are adding to. |
 +|reference |String |An identifier that will be returned with the response to identify each Relationship that was created. |
 +|relationType |String |Id of the Relation Type you would like to create.| ​
 +|startingSide |String |Defines which side of the Relation the Item being added will be on.  Valid values are:|
 +| ::: | ::: |base – The new Item is on the base side.|
 +| ::: | ::: |target – The new Item is on the target side. |
 +
 +**Response XML** - Below is a description of the valid nodes returned in the Response XML from an AddItem request. ​
 +
 +**<​wxResponse></​wxResponse>​** - The root node for the Response XML document. ​
 +
 +**<​callStatus></​callStatus>​** - Contained inside of the wxResponse node, the 
 +callStatus node contains the status of the SOAP call.
 +
 +^callStatus Attributes: ^^^
 +|status |String |The call's status. ​ Values include success and failure. |
 +
 +**<​compatibilityLevel></​compatibilityLevel>​** - Contained inside of the 
 +wxResponse node, the compatibilityLevel node contains the version of the API that
 +was used.
 +
 +**<​dataSet></​dataSet>​** - Contained inside of the wxResponse node, One data set is 
 +returned for each data set in the request document.
 +
 +^dataSet Attributes:​^^^
 +|reference |String |The reference that was defined for the data set in the request document. |
 +
 +**<​item></​item>​** - Contained inside of the dataSet node, defines an Item that was 
 +added to the WorkXpress application.
 +
 +^item Attributes: ^^^
 +|itemId |String |Id of the Item that was added. |
 +|ItemTypeId |String |Item Type id of the Item that was added. |
 +
 +**<​relation></​relation>​** - Contained inside of the item node, the relation node 
 +defines a Relation that was added to the WorkXpress application.
 +
 +^relation Attributes: ^^^
 +|reference |String |The reference that was defined for the Relation Type in the request document. |
 +|relationId |String |Id of the Relationship.|
 +
 +**Examples:​** ​
 +<WRAP center round box 80%>
 +An example of an AddItem request might use the following XML :
 +<​code><​wxRequest> ​
 +    <dataSet reference=”workxpress”>​
 +        <item itemTypeId=”a35234” />
 +        <​fields>​
 +            <field fieldId=”a66969”>​
 +                <​value>​WorkXpress</​value>​
 +            </​field>​
 +            <field fieldId=”a36314”>​
 +                <​value>​http://​www.workxpress.com</​value>​
 +            </​field>​
 +        </​fields>​
 +        <​relations>​
 +            <​relation action=”add” oppositeItemId=”u7436”
 +reference=”account_to_contact”
 +                relationType=”a36495” startingSide=”base”>​
 +                <​fields>​
 +                    <field fieldId=”a36498”>​
 +                        <​value>​Developer</​value>​
 +                    </​field>​
 +                </​fields>​
 +            </​relation>​
 +        </​relations>​
 +    </​dataSet>​
 +</​wxRequest>​ </​code>​
 +</​WRAP>​
 +
 +
 +<WRAP center round box 80%>
 +Corresponding response XML: 
 +<​code><​wxResponse>​
 +    <​callStatus status=”success” />
 +    <​compatibilityLevel>​1</​compatibilityLevel>​
 +    <dataSet reference=”workxpress”>​
 +        <item itemId=”u7563” itemTypeId=”a35234”>​
 +            <​relation reference=”account_to_contact” relationId=”u7564”
 +/>
 +        </​item>​
 +    </​dataSet>​
 +</​wxRequest>​ </​code>​
 +
 +</​WRAP>​
 +
 + 
 + 
    
 ===== Function: UpdateItem ===== ===== Function: UpdateItem =====
Line 421: Line 445:
 as many data sets as you want, allowing you to combine many operations into one call. as many data sets as you want, allowing you to combine many operations into one call.
  
-//dataSet Attributes://  +^dataSet Attributes:^^^ 
-reference String An identifier that will be +|reference ​|String ​|An identifier that will be returned with the response to identify different data sets. | 
-returned with the response +|action ​|String ​ |The operation to perform on the Item.  Valid values are:|    
-to identify different data +| ::: | ::: |delete – Deleted Items are completely removed from WorkXpress and cannot be retrieved. ​ | 
-sets.  +| ::: | ::: |recycle – Recycled Items are not removed from WorkXpress and can be restored. restore – Restores a previously recycled item. | 
-action String The operation to perform on +| ::: | ::: |update – Updates an existing Item.|
-the Item.  Valid values are: +
-  +
-delete – Deleted Items are +
-completely removed from +
-WorkXpress and cannot be +
-retrieved. +
- +
-recycle – Recycled Items +
-are not removed from +
-WorkXpress and can be +
-restored. +
- +
-restore – Restores a +
-previously recycled item. +
- +
-update – Updates an  +
-existing Item.+
    
 **<​items></​items>​** - Contained inside of the dataSet node, the items node contains **<​items></​items>​** - Contained inside of the dataSet node, the items node contains
Line 451: Line 458:
 single item in the data set. single item in the data set.
  
-//item Attributes://  +^item Attributes:^^^  
-itemId String The id of the Item to perform +|itemId ​|String ​|The id of the Item to perform the operation on |
-the operation on +
  
 **<​map></​map>​** - Contained inside of the items node, the map node contains the  **<​map></​map>​** - Contained inside of the items node, the map node contains the 
Line 470: Line 476:
 single Field to retrieve data from. single Field to retrieve data from.
  
-//field Attributes://  +^field Attributes:^^^ 
-fieldId String Id of the Field+|fieldId ​|String ​|Id of the Field|
    
 **<​value></​value>​** - Contained inside of the field node, the value node holds the **<​value></​value>​** - Contained inside of the field node, the value node holds the
Line 479: Line 485:
 node is the parent node for any Relationships that should be added or updated. node is the parent node for any Relationships that should be added or updated.
    
-**<​relation></​relation>​** - Contained inside of the relations node, the relation node +**<​relation></​relation>​** - Contained inside of the relations node, the relation node defines a single Relation to add or update. ​
-defines a single Relation to add or update. ​+
  
-//relation Attributes://  +^relation Attributes:^^^ 
-action String The action to perform on the +|action ​|String ​|The action to perform on the Relationship. ​ Valid values ​are: | 
-Relationship. ​ Valid values +| ::: | ::: |add – Creates a new Relationship.| 
-are:+| ::: | ::: |update – Updates an existing Relationship.| 
 +| ::: | ::: |delete – Deleted Relationships ​are completely removed from WorkXpress and cannot be retrieved.| 
 +::: | ::: |recycle – Recycled Relationships are not removed from WorkXpress and can be restored.| 
 +| ::: | ::: |restore – Restores a previously recycled Relationship. | 
 +|oppositeItemId |String |The Item Id of the Item that you wish to relate the Item you are updating to.  If the action is not set to add, this will be used to find an existing Relationship. | 
 +|reference |String |An identifier that will be returned with the response to identify each Relationship that was created or updated. | 
 +|relationType |String |Id of the Relation Type you would like to create. | 
 +|startingSide |String |Defines which side of the Relation the Item being updated will be on.  Valid values are:| 
 +| ::: | ::: |base – The Item will be on the base side.| 
 +| ::: | ::: |target – The Item will be on the target side. |
  
-add – Creates a new +**Response XML** - Below is a description of the valid nodes returned in the Response XML from an UpdateItem request.
-Relationship. +
- +
-update – Updates an existing  +
-Relationship. +
- +
-delete – Deleted +
-Relationships are completely +
-removed from WorkXpress +
-and cannot be retrieved. +
- +
-recycle – Recycled +
-Relationships are not +
-removed from WorkXpress +
-and can be restored. +
- +
-restore – Restores a +
-previously recycled +
-Relationship.  +
-oppositeItemId String The Item Id of the Item that +
-you wish to relate the Item +
-you are updating to.  If the +
-action is not set to add, this +
-will be used to find an +
-existing Relationship.  +
-reference String An identifier that will be +
-returned with the response to +
-identify each Relationship +
-that was created or updated.  +
-relationType String Id of the Relation Type you +
-would like to create.  +
-startingSide String Defines which side of the +
-Relation the Item being +
-updated will be on.  Valid +
-values are: +
- +
-base – The Item will be on +
-the base side. +
-  +
-target – The Item will be on +
-the target side.  +
- +
-**Response XML** - Below is a description of the valid nodes returned in the Response ​ +
-XML from an UpdateItem request.+
  
 **<​wxResponse></​wxResponse>​** - The root node for the Response XML document. ​ **<​wxResponse></​wxResponse>​** - The root node for the Response XML document. ​
Line 537: Line 508:
 callStatus node contains status of the SOAP call.  callStatus node contains status of the SOAP call. 
  
-//callStatus Attributes://  +^callStatus Attributes:^^^ 
-status String The call's status. ​ Values include +|status ​|String ​|The call's status. ​ Values include success and failure. ​|
-success and failure. ​+
  
 **<​compatibilityLevel></​compatibilityLevel>​** - Contained inside of the  **<​compatibilityLevel></​compatibilityLevel>​** - Contained inside of the 
Line 548: Line 518:
 returned for each data set in the request document. returned for each data set in the request document.
  
-//dataSet Attributes://  +^dataSet Attributes:^^^  
-reference String The reference that was defined +|reference ​|String ​|The reference that was defined for the data set in the request document. ​|
-for the data set in the request +
-document. ​+
  
 **<​item></​item>​** - Contained inside of the dataSet node, defines an Item that was  **<​item></​item>​** - Contained inside of the dataSet node, defines an Item that was 
 updated. updated.
  
-//item Attributes://  +^item Attributes:^^^  
-itemId String Id of the Item that was updated+|itemId ​|String ​|Id of the Item that was updated|
    
 **<​relation></​relation>​** - Contained inside of the item node, the relation node **<​relation></​relation>​** - Contained inside of the item node, the relation node
 defines a Relation that was added or updated. ​ defines a Relation that was added or updated. ​
  
-//relation Attributes://  +^relation Attributes:^^^  
-Reference String The reference that was defined +|Reference ​|String ​|The reference that was defined for the Relation in the request document. ​| 
-for the Relation in the request +|relationId ​|String ​|Id of the Relationship. ​|
-document.  +
-relationId String Id of the Relationship. ​+
  
 **Examples:​** ​ **Examples:​** ​
-//An example of a basic UpdateData request might use the following XML :// + 
-<WRAP center round box 80%> +<WRAP center round box 80%>//An example of a basic UpdateData request might use the following XML :// 
-<​wxRequest+<code>
     <dataSet action=”update” reference=”account”>​     <dataSet action=”update” reference=”account”>​
         <​items>​         <​items>​
Line 593: Line 559:
         </​relations>​         </​relations>​
     </​dataSet>​     </​dataSet>​
-</​wxRequest> ​+</​wxRequest> </code>
  
 </​WRAP>​ </​WRAP>​
  
-//​Corresponding response XML://+
    
-<WRAP center round box 80%>+<WRAP center round box 80%>//​Corresponding response XML://<​code>
 <​wxResponse>​ <​wxResponse>​
     <​callStatus status=”success” />     <​callStatus status=”success” />
Line 608: Line 574:
         </​item>​         </​item>​
     </​dataSet>​     </​dataSet>​
-</​wxRequest>​+</​wxRequest></​code>
 </​WRAP>​ </​WRAP>​
    
Line 628: Line 594:
 as many data sets as you want, allowing you to combine many requests into one call. as many data sets as you want, allowing you to combine many requests into one call.
  
-//dataSet Attributes://  +^dataSet Attributes:^^^  
-reference String An identifier that will be +|reference ​|String ​|An identifier that will be returned with the response to identify different data sets. |
-returned with the response to +
-identify different data sets. +
  
 **<​items></​items>​** - Contained inside of the dataSet node, the items node contains ​ **<​items></​items>​** - Contained inside of the dataSet node, the items node contains ​
Line 639: Line 603:
 single item in the data set. single item in the data set.
  
-//item Attributes://  +^item Attributes:^^^  
-itemId String The id of the Item to run the +|itemId ​|String ​|The id of the Item to run the Action on. |
-Action on. +
  
 **<​map></​map>​** - Contained inside of the items node, the map node contains the  **<​map></​map>​** - Contained inside of the items node, the map node contains the 
Line 658: Line 621:
 a single Action to be executed. ​ a single Action to be executed. ​
  
-//action Attributes:// +^action Attributes:^^^ 
-actionId String Id of the Action ​+|actionId ​|String ​|Id of the Action
  
 **Response XML** - Below is a description of the valid nodes returned in the Response ​ **Response XML** - Below is a description of the valid nodes returned in the Response ​
Line 669: Line 632:
 callStatus the status of the SOAP call. callStatus the status of the SOAP call.
  
-//callStatus Attributes://  +^callStatus Attributes:^^^  
-status String The call's status. ​ Values include +|status ​|String ​|The call's status. ​ Values include success and failure. ​
-success and failure.  + 
-** +**<​compatibilityLevel></​compatibilityLevel>​** - Contained inside of the 
-<​compatibilityLevel></​compatibilityLevel>​** - Contained inside of the +
 wxResponse node, the compatibilityLevel node contains the version of the API that wxResponse node, the compatibilityLevel node contains the version of the API that
 was used. was used.
Line 680: Line 642:
 returned for each data set in the request document. returned for each data set in the request document.
  
-//dataSet Attributes://  +^dataSet Attributes:^^^  
-reference String The reference that was defined +|reference ​|String ​|The reference that was defined for the data set in the request.
-for the data set in the request. ​+
  
 **<​item></​item>​** - Contained inside of the dataSet node, defines a single Item that the  **<​item></​item>​** - Contained inside of the dataSet node, defines a single Item that the 
 Actions were run on. Actions were run on.
  
-//item Attributes://  +^item Attributes:^^^  
-itemId String Id of the Item.+|itemId ​|String ​|Id of the Item.|
  
 **Examples:​** ​ **Examples:​** ​
-//An example of a basic ExecuteAction request might use the following XML :// +<WRAP center round box 80%>//An example of a basic ExecuteAction request might use the following XML :// 
-<WRAP center round box 80%>+<code>
 <​wxResponse> ​ <​wxResponse> ​
     <dataSet reference=”accounts”>​     <dataSet reference=”accounts”>​
Line 703: Line 664:
         </​actions>​         </​actions>​
     </​dataSet>​     </​dataSet>​
-</​wxResponse> ​+</​wxResponse> </code>
 </​WRAP>​ </​WRAP>​
  
  
-//​Corresponding response XML://  +<WRAP center round box 80%>//​Corresponding response XML://  
-<WRAP center round box 80%>+<code>
 <​wxResponse>​ <​wxResponse>​
     <​callStatus status=”success” />     <​callStatus status=”success” />
Line 716: Line 677:
         <item itemId=”u511” />         <item itemId=”u511” />
     </​dataSet>​     </​dataSet>​
-</​wxResponse>​+</​wxResponse></​code>
 </​WRAP>​ </​WRAP>​
    
Line 729: Line 690:
 the clean version of the map definition that must be used in any API call. the clean version of the map definition that must be used in any API call.
   ​   ​
-{{ :​map_builder.gif?​nolink |}}+{{ :​map_builder.gif?​nolink&​500 ​|}}
 ====== Action: Third Party Web Service ====== ====== Action: Third Party Web Service ======
    
Line 743: Line 704:
 such as strings, numbers and booleans. such as strings, numbers and booleans.
  
-{{ :​third_party_web_service.gif?​nolink |}}+{{ :​third_party_web_service.gif?​nolink&​500 ​|}}
  
  
Line 766: Line 727:
 only store a single Item in the format below: only store a single Item in the format below:
  
-<​itemTypeId>​|<​itemId>​ (ex. e8|u1) ​+<​code>​<​itemTypeId>​|<​itemId>​ (ex. e8|u1) ​</​code>​
  
 Multi Item Pickers use a similar format with the addition of a comma to delimit multiple Multi Item Pickers use a similar format with the addition of a comma to delimit multiple
 values: values:
    
-<​itemTypeId>​|<​itemId>,<​itemTypeId>​|<​itemId>​ (ex. e8|u1,​e8|u58)+<​code>​<​itemTypeId>​|<​itemId>,<​itemTypeId>​|<​itemId>​ (ex. e8|u1,​e8|u58)</​code>​
    
 **Select** **Select**
Line 786: Line 747:
 Fields can only store a single Select Option using the format below: Fields can only store a single Select Option using the format below:
    
-e11|<​selectOptionId>​ (ex. e11|a36789) or+<​code>​e11|<​selectOptionId>​ (ex. e11|a36789) or
 <​title>​ (ex. Pounds) or <​title>​ (ex. Pounds) or
-<​altTitle>​ (ex. lbs) +<​altTitle>​ (ex. lbs) </​code>​
    
 Multi Select Fields use a similar format with the addition of a comma to delimit multiple Multi Select Fields use a similar format with the addition of a comma to delimit multiple
 values: values:
    
-e11|<​selectOptionId>,​e11|<​selectOptionId>​ (ex. e11|a36789,​e11|a36791)+<​code>​e11|<​selectOptionId>,​e11|<​selectOptionId>​ (ex. e11|a36789,​e11|a36791)
 or or
 +
 <​title>,<​title>​ (ex. Pounds,​Feet) or  <​title>,<​title>​ (ex. Pounds,​Feet) or 
-<​altTitle>,<​altTitle>​ (ex. lbs,ft)+ 
 +<​altTitle>,<​altTitle>​ (ex. lbs,ft)</​code>​
  
 **Check Box**  **Check Box** 
Line 813: Line 776:
   ​   ​
 <WRAP center round box 80%> <WRAP center round box 80%>
 +<​code>​
 // convert a date value // convert a date value
 $date = '​01/​19/​1985';​ $date = '​01/​19/​1985';​
Line 823: Line 787:
 // convert a time value // convert a time value
 $time = '11:35 AM'; $time = '11:35 AM';
-$time_stamp = strtotime('​January 1, 1970 '​.$time);​+$time_stamp = strtotime('​January 1, 1970 '​.$time);​</​code>​ 
 +</​WRAP>​
  
 +
 +For more information on Date Fields, visit
 +http://​www.workxpress.com/​training/​date. ​
 +
 +
 + 
 +**File Attachment**
 + 
 +File Attachment Fields are what is known as a multi-part Field. ​ These Fields are stored
 +as XML that separate different parts of the full value. ​ In order to set a File Attachment
 +Field through the API you will need to base 64 encode the binary file and place that
 +into the encoded file part of the XML.  In PHP you would using the following code:
 + 
 +<WRAP center round box 80%>
 +<​code>​
 +$file_path = '/​path/​to/​file.odf';​
 +$encoded_file = base64_encode(file_get_contents($file_path));​
 +</​code>​
 </​WRAP>​ </​WRAP>​
 +
    
  
 +For more information on File Fields, please visit
 +http://​www.workxpress.com/​training/​file-attachment. ​
 +
 +
 +File Attachment Fields use the following XML format:
 +
 +**<​multi_part_field></​multi_part_field>​** - Root node for all multi-part Fields.
 + 
 +**<​part></​part>​** - Defines the value for a single part of the Field.
 + 
 +
 +^Attributes:​^^^ ​
 +|id |String |The name of the part.  Valid values include:|
 +| ::: | ::: |filename – The name to be given to the file, including extension.|
 +| ::: | ::: |mime_type – The file's mime type. |
 +| ::: | ::: |size – The file's size in bytes.|
 +| ::: | ::: |encoded_file – The base 64 encoded file. |
 +
 +**Example:​** ​
 + 
 +<WRAP center round box 80%>
 +<​code>​
 +<?xml version=”1.0”?>​
 +<​multi_part_field>​
 +    <part id=”filename”>​image.png</​part>​
 +    <part id=”mime_type”>​image/​png</​part>​
 +    <part id=”size”>​364544</​part>​
 +    <part id=”encoded_file”>​encodedFile</​part>​
 +</​multi_part_field>​
 +</​code>​
 +</​WRAP>​
 +
 + 
 +
 +**Address** ​
 + 
 +Address Fields are also multi-part Fields. ​ Address Fields can be one of two different
 +types: US and International. ​ This type will need to be defined when setting an Address
 +Field through the API.  For more information on Address Fields, please see
 +http://​www.workxpress.com/​training/​address. ​
 +
 +Address Fields use the following XML format: ​
 +
 +**<​multipart_field></​multi_part_field>​** - Root node for all multi-part Fields. ​
 + 
 +**<​part></​part>​** - Defines the value for a single part of the Field. ​
 +
 +^Attributes:​^^^
 +|id |String |The name of the part.  Valid values include:|
 +| ::: | ::: |street – The value for the first street part.|
 +| ::: | ::: |street2 – The value for the second street part.|
 +| ::: | ::: |street3 – The value for the third street part, only used for international addresses.|
 +| ::: | ::: |city – The value for the city.|
 +| ::: | ::: |state – The value for the state, up to three characters for international and two characters for United States.|
 +| ::: | ::: |zip_code – The value for the postal code.  Should be numeric for United States addresses.|
 +| ::: | ::: |country – The value for the country. ​ Should be the countries full fame or the ISO 3166-1 alpha-3 formatted country code (see http://​en.wikipedia.org/​wiki/​IS O_3166-1_alpha-3).|
 +| ::: | ::: |type – Should be either International or United States.|
 +| ::: | ::: |sort_value – Which street value should be used to sort this field. Should be either street, street2 or street3. ​ Only used for International address. |
 + 
 +**Example:​**
 + 
 +<WRAP center round box 80%><​code>​
 +<?xm version=”1.0”?>​
 +<​multi_part_field>​
 +    <part id=”street”>​Ostvorstadt</​part>​
 +    <part id=”street2”>​Hauptstraße 5</​part>​
 +    <part id=”street3”></​part>​
 +    <part id=”city”>​Musterstadt</​part>​
 +    <part id=”state”></​part>​
 +    <part id=”zip_code”>​01234</​part>​
 +    <part id=”country”>​Germany</​part>​
 +    <part id=”type”>​International</​part>​
 +    <part id=”sort_value”>​street2</​part>​
 +</​multi_part_field>​
 +</​code></​WRAP>​
 + 
 +
 +**Phone Number** ​
 +
 +Phone Number Fields are also multi-part. ​ Like Address Fields, Phone Numbers can be
 +either International or United States. ​ For more information on Phone Number Fields,
 +visit
 +http://​www.workxpress.com/​training/​phone-number. ​
 +
 +Phone Number Fields use the following XML format: ​
 +
 +**<​multipart_field></​multi_part_field>​** - Root node for all multi-part Fields. ​
 +
 +**<​part></​part>​** - Defines the value for a single part of the Field.
 + 
 +
 +^Attributes:​^^^ ​
 +|id |String |The name of the part.  Valid values include:|
 +| ::: | ::: |area_code – The value for the area code.  Should be three digits for United States and up to five alphanumeric characters for International.|
 +| ::: | ::: |prefix – For United States phone numbers, this is the three digits immediately following the area code.  This is not used for International numbers.|
 +| ::: | ::: |line_number – For United States phone numbers, this is the last four digits of the number. ​ For International phone numbers, this is the entire number ​ after the area code. |
 +| ::: | ::: |extension – The value for the extension (if any).|
 +| ::: | ::: |country_code – The country calling code for International Phone Numbers. ​ Should be 1 for United States. |
 +| ::: | ::: |type – Should be either International or United States. |
 +
 +**Example:​** ​
 + 
 +<WRAP center round box 80%>
 +<​code>​
 +<?xm version=”1.0”?>​
 +<​multi_part_field>​
 +    <part id=”area_code”>​717</​part>​
 +    <part id=”prefix”>​609</​part>​
 +    <part id=”line_number”>​0029</​part>​
 +    <part id=”extension”>​123</​part>​
 +    <part id=”country_code”>​1</​part>​
 +    <part id=”type”>​United States</​part>​
 +</​multi_part_field>​
 +</​code>​
 +</​WRAP>​
 +
 +
 +====== Display Format Parts ======
 +
 + 
 + 
 +
 +WorkXpress provides several display format parts available through the API.  These
 +parts can be used to format Field values from the LookupData function. ​ For example,
 +say you want to format an address as follows:
 +
 +453 Lincoln Street - Carlisle, PA 17013
 +
 +You could use a display format part as the value for the format node as follows:
 + 
 +<WRAP center round box 60%>
 +<format type=”text”>​Street - City, State ZipCode</​format>​
 +</​WRAP>​
 +
 + 
 +You can use display format parts for either html or text formatted Fields. ​ When using
 +the stored format, display format parts are ignored. ​ Below is a list of the display
 +format parts available for each Field Type.
 + 
 +**Address**
 +  * Unordered List ItemType – The type of address, either United States or International
 +  * Street – The first street input
 +  * Street2 – The second street
 +  * Street3 – The third street of an International address
 +  * City
 +  * State
 +  * ZipCode – The postal code
 +  * Country ​
 +
 +**Currency** ​
 +  * Unordered List ItemNumberOnly – Returns the value without the preceding dollar sign ($)
 + 
 +**Phone**
 +  * Unordered List ItemType – The type of phone number, either United States or International
 +  * CountryCode ​
 +  * AreaCode
 +  * Prefix – The three digits immediately following the area code in a United States phone number
 +  * LineNumber – The remaining digits of the phone number ​
 +  * Extension
 +
 +**Select – Select One** 
 +  * Unordered List ItemAltTitle – Returns the alternate title of the Select Option currently stored as the Field'​s value 
 +  * WithOther – Returns the title of the Select Option along with the value of the “Other” Field associated with the Select Option separated by a hyphen (if one exists).
 +  * OtherOnly – Returns only the value of the “Other” Field associated with the Select Option.  ​
 +
 +**Check Box**
 +  * Unordered List ItemChecked – Returns the word “CHECKED” if the Field is checked and “UNCHECKED” if it is not.
 +  * FieldLabel – Returns the Field'​s label if it is checked and nothing if it is not. 
 +  * WithOther – Returns the same as the “Checked” display format part with the value of the “Other” Field associated with the Field'​s current value separated by a hyphen (id one exists).
 +  * OtherOnly – Returns only the value of the “Other” Field associated with the Field'​s current value
 + 
 +**Date and Date Time**
 +  * Unordered List ItemAMPMLowercase – Returns the appropriate am/pm value.
 +  * AMPMUppercase – Returns the appropriate AM/PM value.
 +  * DayOfMonth ​ - Day of the month without leading zeros
 +  * DayOfMonthSuffix – English ordinal suffix for the day of the month, 2 characters
 +  * DayOfMonthLeadingZero – Day of the month, 2 digits with leading zeros 
 +  * DayOfWeek – A full textual representation of the day of the week
 +  * DayOfWeekAbbreviated – A textual representation of a day, three letters
 +  * DayOfWeekNumber – ISO-8601 numeric representation of the day of the week
 +  * DayOfYear – The day of the year (starting from 0) 
 +  * Hour – 12-hour format of an hour without leading zeros
 +  * Hour24 – 24-hour format of an hour without leading zeros
 +  * Hour24LeadingZero – 24-hour format of an hour with leading zeros
 +  * HourLeadingZero – 12-hour format of an hour with leading zeros
 +  * Minute - Minutes with leading zeros
 +  * MonthName – A full textual representation of a month
 +  * MonthNameAbbreviated – A short textual representation of a month, three letters
 +  * MonthOfYear – Numeric representation of a month, without leading zeros 
 +  * MonthOfYearLeadingZero – Numeric representation of a month, with leading zeros 
 +  * Second – Seconds, with leading zeros 
 +  * Timestamp – Seconds since the Unix Epoch (January 1 1970 00:00:00 GMT)
 +  * WeekOfYear – ISO-8601 week number of year, weeks starting on Monday
 +  * Year – A full numeric representation of a year, 4 digits
 +  * YearShort – A two digit representation of a year 
 +
 +**File** ​
 +  * Unordered List ItemDownloadURL – URL to download the file.  If the Field is not set to allow the File to be public, this URL will require a login. ​
 +  * Filename – The name of the file, including extension
 +  * FileSize – The size of the file in bytes
 +  * Height – The height in pixels if the file is an image
 +  * Image – Returns an HTML image tag if the file is an image
 +  * MimeType – The file's mime type • Thumbnail – Returns an HTML image tag to the file's thumbnail if it is an image
 +  * ThumbnailURL – URL to retrieve the thumbnail if the file is an image. ​ If the Field is not set to allow the File to be public, this URL will require a login.
 +  * Width – The width in pixels if the file is an image 
 +
 +**Social Security Number**
 + 
 +  * Unordered List ItemItemLastFour – Returns only the last four digits of the social security number ​
 + 
  
    
api.txt · Last modified: 2016/09/14 18:19 (external edit)
Copyright WorkXpress, 2024