DX NetOps

Expand all | Collapse all

DeviceGeoTag issue

Jump to Best Answer
  • 1.  DeviceGeoTag issue

    Posted 07-06-2017 08:01 AM

    We try to use the app Geo-Tag that we found on https://github.com/CA-PM/DeviceGeoTag.
    When we try to add a location we receive an alert message: “Failure: Forbidden”.
    The used account has administrator privileges.
    We tried to open the link (“https://da_hostname:8182/pc/da/rest/devices/775”) with a browser and we received the same message.
    We tried to add the location from a REST client using the URL “http://da_hostname:8581/rest/devices/itemID” and it worked.
    In fact if we open the Geo-Tag app for the device which we inserted the geographic information we can see the fields.

     

    This is the part of the code that gives us the problem:

     

    var thisUrl="/pc/da/rest/devices/" + deviceID;

    var xmlPayload='<Device version="1.0.0">\n' +
      '<Longitude>' + longitude + '</Longitude>\n' +
    '<Latitude>' + latitude + '</Latitude>\n' +
      '<Elevation>0</Elevation>\n' +
      '<LocationDesc>' + locDesc + '</LocationDesc>\n' +
    '</Device>';

     

    $.ajax({
      url: thisUrl,
      type: 'PUT',
      contentType: "application/xml",
      data: xmlPayload,
      success: function(data) {
        alert('Attributes succesfully set.\n'+
        'Please wait for next sync process to view in CAPC or ETL OpenAPI job.');
    },
      error:function(data){
                alert("Failure: " + data.statusText);
            }
    });

     

    Can someone confirm that there is a mistake in the code, or do we have a problem on our side ?

    Thanks,

    Veronique



  • 2.  Re: DeviceGeoTag issue

    Posted 07-07-2017 02:20 AM

    Hello Veronique,

    are you using non-admin user in this case? Then a permission is needed. Please see CA PC Apps and User Authorization 

    Hth, Lutz.



  • 3.  Re: DeviceGeoTag issue

    Posted 07-07-2017 02:30 AM
      |   view attached

    Hi,

    We are using an admin account.

    The problem seems more to be with the URL, Either the protocol (http-https) and/or the port (8182/8581) and/or the path itself (/pc/da/rest/devices versus /rest/devices) .

    Thanks,

    Veronique



  • 4.  Re: DeviceGeoTag issue
    Best Answer

    Posted 07-07-2017 02:38 AM

    do you use "admin" user or another user with administrative role? By default only "admin" user has access to DA rest via CA PC proxy url /pc/da/rest.



  • 5.  Re: DeviceGeoTag issue

    Posted 07-07-2017 02:42 AM
      |   view attached

    Ah, ok! We use an account with admin role, not the “admin” account indeed.

    Thanks!

    veronique



  • 6.  Re: DeviceGeoTag issue

    Posted 07-07-2017 02:47 AM

    ok good. I clarified the verbiage in the other article with explicit mention of UserName=admin.