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