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 20:49]
lisa [Function: AddItem]
api [2012/08/07 21:31]
lisa [WorkXpress API Data Formats]
Line 352: Line 352:
 **<​dataSet></​dataSet>​** - Contained inside of the wxResponse node, One data set is  **<​dataSet></​dataSet>​** - Contained inside of the wxResponse node, One data set is 
 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 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>​
 +
 + 
    
    
Line 383: Line 447:
 ^dataSet Attributes:​^^^ ^dataSet Attributes:​^^^
 |reference |String |An identifier that will be returned with the response to identify different data sets. | |reference |String |An identifier that will be returned with the response to identify different data sets. |
-|action |String ​ |The operation to perform on the Item.  Valid values are    +|action |String ​ |The operation to perform on the Item.  Valid values are:|    
-delete – Deleted Items are completely removed from WorkXpress and cannot be +| ::: | ::: |delete – Deleted Items are completely removed from WorkXpress and cannot be retrieved.  ​
-retrieved. ​ recycle – Recycled Items are not removed from WorkXpress and can be +| ::: | ::: |recycle – Recycled Items are not removed from WorkXpress and can be restored. restore – Restores a previously recycled item. 
-restored. restore – Restores a previously recycled item. update – Updates an  +| ::: | ::: |update – Updates an existing Item.|
-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 396: Line 459:
  
 ^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 423: 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 are:+| ::: | ::: |add – Creates a new 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. |
  
-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 491: Line 519:
  
 ^dataSet Attributes:​^^^ ​ ^dataSet Attributes:​^^^ ​
-|reference |String |The reference that was defined 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, defines an Item that was  **<​item></​item>​** - Contained inside of the dataSet node, defines an Item that was 
Line 504: Line 531:
  
 ^relation Attributes:​^^^ ​ ^relation Attributes:​^^^ ​
-|Reference |String |The reference that was defined for the Relation in the request +|Reference |String |The reference that was defined for the Relation in the request document. |
-document. |+
 |relationId |String |Id of the Relationship. | |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 :// 
-<code><​wxRequest+<​code>​
     <dataSet action=”update” reference=”account”>​     <dataSet action=”update” reference=”account”>​
         <​items>​         <​items>​
Line 537: Line 563:
 </​WRAP>​ </​WRAP>​
  
-//​Corresponding response XML://+
    
-<WRAP center round box 80%><​code>​+<WRAP center round box 80%>//​Corresponding response XML://<​code>​
 <​wxResponse>​ <​wxResponse>​
     <​callStatus status=”success” />     <​callStatus status=”success” />
Line 626: Line 652:
  
 **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>​+<​code>​
 <​wxResponse> ​ <​wxResponse> ​
     <dataSet reference=”accounts”>​     <dataSet reference=”accounts”>​
Line 642: Line 668:
  
  
-//​Corresponding response XML://  +<WRAP center round box 80%>//​Corresponding response XML://  
-<WRAP center round box 80%><​code>​+<​code>​
 <​wxResponse>​ <​wxResponse>​
     <​callStatus status=”success” />     <​callStatus status=”success” />
Line 664: 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 678: 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 728: Line 754:
 values: values:
    
-<​code>​e11|<​selectOptionId>,​e11|<​selectOptionId>​ (ex. e11|a36789,​e11|a36791)</​code>​+<​code>​e11|<​selectOptionId>,​e11|<​selectOptionId>​ (ex. e11|a36789,​e11|a36791)
 or or
  
-<​code>​<​title>,<​title>​ (ex. Pounds,​Feet) or +<​title>,<​title>​ (ex. Pounds,​Feet) or 
  
 <​altTitle>,<​altTitle>​ (ex. lbs,​ft)</​code>​ <​altTitle>,<​altTitle>​ (ex. lbs,​ft)</​code>​
Line 749: Line 775:
 standard date or date time format into a Unix time stamp: standard date or date time format into a Unix time stamp:
   ​   ​
 +<WRAP center round box 80%>
 <​code>​ <​code>​
 // convert a date value // convert a date value
Line 761: Line 788:
 $time = '11:35 AM'; $time = '11:35 AM';
 $time_stamp = strtotime('​January 1, 1970 '​.$time);</​code>​ $time_stamp = strtotime('​January 1, 1970 '​.$time);</​code>​
 +</​WRAP>​
 +
  
 For more information on Date Fields, visit For more information on Date Fields, visit
Line 774: Line 803:
 into the encoded file part of the XML.  In PHP you would using the following code: into the encoded file part of the XML.  In PHP you would using the following code:
    
-<WRAP center round box 60%>+<WRAP center round box 80%>
 <​code>​ <​code>​
 $file_path = '/​path/​to/​file.odf';​ $file_path = '/​path/​to/​file.odf';​
Line 794: Line 823:
    
  
-//Attributes://  +^Attributes:^^^  
-id String The name of the part.  Valid +|id |String ​|The name of the part.  Valid values include:| 
-values include: +| ::: | ::: |filename – The name to be given to the file, including extension.| 
- +| ::: | ::: |mime_type – The file's mime type. | 
-filename – The name to be +| ::: | ::: |size – The file's size in bytes.| 
-given to the file, including +| ::: | ::: |encoded_file – The base 64 encoded file. |
-extension. +
- +
-mime_type – The file's mime +
-type. +
- +
-size – The file's size in bytes. +
- +
-encoded_file – The base 64 +
-encoded file. +
  
 **Example:​** ​ **Example:​** ​
    
-<WRAP center round box 60%>+<WRAP center round box 80%>
 <​code>​ <​code>​
 <?xml version=”1.0”?>​ <?xml version=”1.0”?>​
Line 839: Line 859:
 **<​part></​part>​** - Defines the value for a single part of the Field. ​ **<​part></​part>​** - Defines the value for a single part of the Field. ​
  
-//Attributes:// +^Attributes:^^^ 
-id String The name of the part.  Valid  +|id |String ​|The name of the part.  Valid values include:| 
-  +| ::: | ::: |street – The value for the first street part.| 
-values include: +| ::: | ::: |street2 – The value for the second street part.| 
- +| ::: | ::: |street3 – The value for the third street part, only used for international ​addresses.| 
-street – The value for the first +| ::: | ::: |city – The value for the city.| 
-street part. +| ::: | ::: |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.| 
-street2 – The value for the +| ::: | ::: |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).| 
-second street part. +| ::: | ::: |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. ​|
-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 name 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:​** **Example:​**
    
-<​code>​<WRAP center round box 60%>+<WRAP center round box 80%><​code>
 <?xm version=”1.0”?>​ <?xm version=”1.0”?>​
 <​multi_part_field>​ <​multi_part_field>​
Line 898: Line 886:
     <part id=”sort_value”>​street2</​part>​     <part id=”sort_value”>​street2</​part>​
 </​multi_part_field>​ </​multi_part_field>​
-</WRAP></code>+</code></WRAP>
    
  
Line 915: Line 903:
    
  
-//Attributes://  +^Attributes:^^^  
-id String The name of the part.  Valid values +|id |String ​|The name of the part.  Valid values include:| 
-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.| 
-area_code – The value for the area +| ::: | ::: |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. | 
-code.  Should be three digits for +::: | ::: |extension – The value for the extension (if any).| 
-United States and up to five alphanumeric +| ::: | ::: |country_code – The country calling code for International Phone Numbers. ​ Should be 1 for United States. | 
-characters +| ::: | ::: |type – Should be either International or United States. ​|
-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.  +
- +
-Example +
-  +
-<​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>​ +
-  +
- +
-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:​** ​ **Example:​** ​
    
-<​code>​<WRAP center round box 60%>+<WRAP center round box 80%
 +<code>
 <?xm version=”1.0”?>​ <?xm version=”1.0”?>​
 <​multi_part_field>​ <​multi_part_field>​
Line 976: Line 925:
     <part id=”type”>​United States</​part>​     <part id=”type”>​United States</​part>​
 </​multi_part_field>​ </​multi_part_field>​
-</WRAP></code>+</code> 
 +</WRAP> 
  
 ====== Display Format Parts ====== ====== Display Format Parts ======
api.txt · Last modified: 2016/09/14 18:19 (external edit)
Copyright WorkXpress, 2024