Forum Discussion

ldelagoutte's avatar
4 years ago

how to Retrieve subscribed labels thru API ?

Hi

I want to get label's text a user subscribed to.

So I use :

 api/2.0/search?q=SELECT * FROM subscriptions where target.type = 'label' and subscriber.id='<my user id>' ==> this gives me a list of label id

But I can not use these ids like api/2.0/search?q=SELECT * FROM labels where id = '13'

because I get "Invalid query syntax".

I read that  "Queries to the labels collection must be constrained by messages.id."

But where I can get this message.id ? Is there a better way to get the text of my labels ?

 

Thanks