Planfix API analitic.getData: Difference between revisions
From Planfix
								
												
				|  (Created page with "Getting data tags attached by action. The list of available data tags is obtained from the list of actions. Request format: <source lang="xml"> <?xml version="1.0" encoding="UTF-8"?> <request method="analitic.getData">   <account></account>   <sid></sid>   <analiticKeys>     <key></key>     <key></key>     <!-- ... -->   </analiticKeys>   <signature></signature> </request> </source> {| class="wikitable" style="margin-top: 1em; w...") | No edit summary | ||
| Line 1: | Line 1: | ||
| Getting data tags attached by action. The list of available data tags is obtained from the [[ | Getting data tags attached by action. The list of available data tags is obtained from the [[Planfix API analitic.getList|list of actions]]. Request format: | ||
| <source lang="xml"> | <source lang="xml"> | ||
| <?xml version="1.0" encoding="UTF-8"?> | <?xml version="1.0" encoding="UTF-8"?> | ||
Revision as of 14:19, 4 March 2024
Getting data tags attached by action. The list of available data tags is obtained from the list of actions. Request format:
<?xml version="1.0" encoding="UTF-8"?>
<request method="analitic.getData">
  <account></account>
  <sid></sid>
  <analiticKeys>
    <key></key>
    <key></key>
    <!-- ... -->
  </analiticKeys>
  <signature></signature>
</request>| Name | Type | Value | Note | 
|---|---|---|---|
| sid | string(32) | session key | issued as a result of authentication | 
| analiticKeys.key | int | dentifier of the data analytics line | returned by the action.get function | 
It is allowed to get data of several added data tags with one request. If an identifier for a non-existent data tag was passed in the request, then empty data tags will be returned, and no error will be generated.
Response when the request is successfully executed:
<?xml version="1.0" encoding="UTF-8"?>
<response status="ok">
  <analiticDatas>
    <analiticData>
      <key></key>
      <itemData>
        <id></id>
        <name></name>
        <value></value>
        <valueId></valueId>
      </itemData>
      <itemData>
        <id></id>
        <name></name>
        <value></value>
        <valueId></valueId>
      </itemData>
      <!-- ... -->
    </analiticData>
    <analiticData>
      <key></key>
      <itemData>
        <id></id>
        <name></name>
        <value></value>
        <valueId></valueId>
      </itemData>
      <itemData>
        <id></id>
        <name></name>
        <value></value>
        <valueId></valueId>
      </itemData>
      <!-- ... -->
    </analiticData>
    <!-- ... -->
  </analiticDatas>
</response>| Name | Type | Value | Note | 
|---|---|---|---|
| analiticDatas | list of requested data tags | ||
| analiticData | node describing the data contained in the data tag | ||
| analiticData.key | int | data identifier | |
| analiticData.itemData | node describing the entry with data in the data tag | ||
| itemData.id | int | identifier, it is equal to field.id | |
| itemData.name | string | field name | |
| itemData.value | string | value (string representation) | |
| itemData.valueId | string | value (identifier for fields containing an object) | 
Otherwise, a response with an error will be returned:
<?xml version="1.0" encoding="UTF-8"?>
<response status="error">
  <code></code>
</response>