cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
822
Views
5
Helpful
6
Replies

AXL how to get the AppUser id with device number

eran.finish
Level 1
Level 1

Hello,

For jabber AXL API, how do I get the App User Id by device number or userName or some indicator? 

1 Accepted Solution

Accepted Solutions

npetrele is correct in that the below request may return more than one row of matches, but in case it's helpful, you can use something like this <executeSqlQuery> request:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.cisco.com/AXL/API/14.0">
   <soapenv:Header/>
   <soapenv:Body>
      <ns:executeSQLQuery sequence="1">
         <sql>select applicationuser.name,applicationuser.pkid
              from device,applicationuser,applicationuserdevicemap 
              where applicationuserdevicemap.fkapplicationuser = applicationuser.pkid
              and applicationuserdevicemap.fkdevice = device.pkid
              and device.name = "CSFDSTAUDT"</sql>
      </ns:executeSQLQuery>
   </soapenv:Body>
</soapenv:Envelope>

Response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Body>
      <ns:executeSQLQueryResponse xmlns:ns="http://www.cisco.com/AXL/API/14.0">
         <return>
            <row>
               <name>testAppUser</name>
               <pkid>0085d951-9f27-a128-e2f7-378783caffc5</pkid>
            </row>
         </return>
      </ns:executeSQLQueryResponse>
   </soapenv:Body>
</soapenv:Envelope>

View solution in original post

6 Replies 6

npetrele
Cisco Employee
Cisco Employee

Could you rephrase that or provide some more details?  I don't understand the question.

For every app user we have a list of associated Devices.

I need away to know what is The appUser that is associated with a certain device number.

A device can be controlled by more than one app user. There's not a one-to-one relationship between a device and an app user.

npetrele is correct in that the below request may return more than one row of matches, but in case it's helpful, you can use something like this <executeSqlQuery> request:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.cisco.com/AXL/API/14.0">
   <soapenv:Header/>
   <soapenv:Body>
      <ns:executeSQLQuery sequence="1">
         <sql>select applicationuser.name,applicationuser.pkid
              from device,applicationuser,applicationuserdevicemap 
              where applicationuserdevicemap.fkapplicationuser = applicationuser.pkid
              and applicationuserdevicemap.fkdevice = device.pkid
              and device.name = "CSFDSTAUDT"</sql>
      </ns:executeSQLQuery>
   </soapenv:Body>
</soapenv:Envelope>

Response:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Body>
      <ns:executeSQLQueryResponse xmlns:ns="http://www.cisco.com/AXL/API/14.0">
         <return>
            <row>
               <name>testAppUser</name>
               <pkid>0085d951-9f27-a128-e2f7-378783caffc5</pkid>
            </row>
         </return>
      </ns:executeSQLQueryResponse>
   </soapenv:Body>
</soapenv:Envelope>

For what it's worth, here's a sample when the device is controlled by more than one app user:

 

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns="http://www.cisco.com/AXL/API/12.5">
   <soapenv:Header/>
   <soapenv:Body>
      <ns:executeSQLQuery>
         <sql>select applicationuser.name,applicationuser.pkid
              from device,applicationuser,applicationuserdevicemap 
              where applicationuserdevicemap.fkapplicationuser = applicationuser.pkid
              and applicationuserdevicemap.fkdevice = device.pkid
              and device.name = "SEP001EF727852D"</sql>
      </ns:executeSQLQuery>
   </soapenv:Body>
</soapenv:Envelope>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/">
   <soapenv:Body>
      <ns:executeSQLQueryResponse xmlns:ns="http://www.cisco.com/AXL/API/12.5">
         <return>
            <row>
               <name>norbert</name>
               <pkid>47f7c497-1e96-3724-f034-6fb56204cb0a</pkid>
            </row>
            <row>
               <name>daggett</name>
               <pkid>63e82413-5626-6a33-40ae-7a91a45635d9</pkid>
            </row>
         </return>
      </ns:executeSQLQueryResponse>
   </soapenv:Body>
</soapenv:Envelope>

You would need some other criteria to determine which app user you were looking for.

Thank You all For The Fast reply