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
Last revision Both sides next revision
en:pro:remoteapi:codesamples:search [06/03/2013 15:54]
zuve
en:pro:remoteapi:codesamples:search [18/01/2016 12:55]
stan [Search items by property]
Line 14: Line 14:
  "​itemId":​48,​  "​itemId":​48,​
  "​flags":​1025  "​flags":​1025
- }&sid=<​your_sid>​+ }&ssid=<​your_sid>​
 </​code>​ </​code>​
  
Line 65: Line 65:
           "​from":​0,​           "​from":​0,​
           "​to":​0xffffffff           "​to":​0xffffffff
- }&sid=<​your_sid>​+ }&ssid=<​your_sid>​
 </​code>​ </​code>​
 Asterisk in the parameter //​propValueMask//​ means that in the result array there will be users with any values in the field //​sys_name//​ (that is users of any names). It means all available users will be present in the result. Value "​1"​ of the parameter //flags// means that basic information about the item must be included in the result. Detailed information about user flags is given in the chapter [[../​apiref/​format/​user]]. Values of the parameters //from// and //​to// ​ which equals to 0 and 0xffffffff accordingly,​ indicate that all found users should be returned. Asterisk in the parameter //​propValueMask//​ means that in the result array there will be users with any values in the field //​sys_name//​ (that is users of any names). It means all available users will be present in the result. Value "​1"​ of the parameter //flags// means that basic information about the item must be included in the result. Detailed information about user flags is given in the chapter [[../​apiref/​format/​user]]. Values of the parameters //from// and //​to// ​ which equals to 0 and 0xffffffff accordingly,​ indicate that all found users should be returned.
Line 100: Line 100:
     }]     }]
 } }
 +</​code>​
 +
 +==== search units by creator ====
 +
 +<​code>​
 +<​your_wialon_pro_address>/​ajax.html?​svc=core/​search_items&​
 + params={
 + "​spec":​{
 + ​ "​itemsType":"​avl_unit",​
 + "​propName":"​22sys_user_creator",​
 +    "​propValueMask":"​22ac745a8ec8eb54469607d30bfeffb807", ​     /* creators "​gd"​ property */
 + "​sortType":"​sys_name"​
 + },
 +                "​force":​1,​
 +          "​flags":​1,​
 +          "​from":​0,​
 +          "​to":​0xffffffff
 + }&​ssid=<​your_sid>​
 +</​code>​
 +
 +Response:
 +
 +<code javascript>​
 +{
 +    searchSpec: {
 +        itemsType: "​avl_unit",​
 +        propName: "​sys_user_creator",​
 +        propValueMask:​ "​ac745a8ec8eb54469607d30bfeffb807",​
 +        sortType: "​sys_name"​
 +    },
 +    dataFlags: 1,
 +    totalItemsCount:​ 3,
 +    indexFrom: 0,
 +    indexTo: 2,
 +    items: [{
 +        nm: "​unit1",​
 +        cls: 3,
 +        id: 554
 +    },{
 +        nm: "​unit2",​
 +        cls: 3,
 +        id: 558
 +    },{
 +        nm: "​unit3",​
 +        cls: 3,
 +        id: 559
 +    }]
 +}
 +
 </​code>​ </​code>​
Follow us on Facebook Gurtam Wialon Twitter Gurtam Wialon info@gurtam.com   |   Copyright © 2002-2024 Gurtam