Hello. We are trying to use the RESTful API to get a list of targets in a target collection, so we can get the Target IDs for later use in update and delete commands.
However, when we use cURL to execute this, we are getting an empty string. When we use the ColdFusion CFHTTP equivalent, we get the html of a form asking us to authenticate.
This is the documentation we are following: https://www.wikitude.com/external/doc/documentation/studio-api/index.html#api-Target-GetTargets
A sample of the cURL command we are using is:
curl https://api-us.wikitude.com/targetCollection/5b8d81a701f6bf322f227819 --header "X-Version: 3" --header "X-Token: xxxxxxxxx"
Our other usage of the RESTful API to create targets and delete them (after manually looking up a Target ID in the studio manager) is successful.
Is there something else we should be doing to get the Target IDs from the target collection?
You used the wrong URI - Check out this cURL:
curl -X GET \ https://api-us.wikitude.com/cloudrecognition/targetCollection/5b8d81a701f6bf322f227819/target \ -H 'X-Token: <your manager token>' \ -H 'X-Version: 3'
Hope that helps,