Start a new topic

RESTful API Get Targets command returning empty string?

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?

Thank you!




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,

Christian

Thanks. That did the trick.

Note, however, that the "/cloudrecognition/" portion of the URI you provided is not included in the documentation page. It lists "/targetCollection/:tcId/target" as the reference link (with ":tcId" as the target collection id)

See https://www.wikitude.com/external/doc/documentation/studio-api/index.html?&_ga=2.54102639.616305595.1538427441-491597341.1533232299#api-Target-GetTargets

Thank you!


 

Login or Signup to post a comment