0

I wanted to get all the devices tagged with a given string using a REST API. I have tried curl -X GET -u "$user_name:$api_key" https://api.softlayer.com/rest/v3/SoftLayer_Tag/iisha7/getReferences but it didn't work. It is giving this error:

{"error":"Internal Error","code":"SoftLayer_Exception_Public"}

Does this solve my purpose? or should I use another API? If it does, what is the mistake I am doing? Please suggest.

1 Answers1

0

Try using this request:

https://api.softlayer.com/rest/v3/SoftLayer_Account/getTags?objectFilter={"tags":{"name":{"operation":"tag2"}}}&objectMask=mask[references]

Note: replace "tag2" with the name of the tag you are lokking for

Regards

  • Thanks Nelson, it works from Postman. Can you please tell me how to call it from curl? It gives me the following error when I call it from curl. curl: (3) [globbing] nested braces not supported at pos 8 – Krishna Kishore Bonagiri Mar 24 '17 at 17:32
  • see this http://stackoverflow.com/questions/42923676/unable-to-url-encode-for-object-filters-in-softlayer-rest-uri you need to enconde the filters in curl Also I saw somebodies who are able to make it work with the curl options -g -v, but that never worked for me. – Nelson Raul Cabero Mendoza Mar 24 '17 at 17:40