Public
Occasional Contributor

Rest API with LIQL to get the Labels and Tags gives error

I am trying to get the label and tags of a conversation. 

Here is a sample topic

https://www.paypal-community.com/t5/My-Money/How-can-i-take-money-out-without-a-bank-account/td-p/74...

It has the following two label names "Add or Withdraw Money" & "Bank Accounts & Credit Cards" 

I am able to pull the messages using this snippet

https://www.paypal-community.com/api/2.0/search?q=SELECT * FROM messages WHERE topic.id='745517' LIM...

But I get an error when I run this

https://www.paypal-community.com/api/2.0/search?q=SELECT * FROM labels WHERE message.id='745517'

Error I get is the following

{"status":"error","message":"Invalid query syntax","data":{"type":"error_data","code":604,"developer_message":"","more_info":""},"metadata":{}}

Same issue when I try to pull tags

How can I fix this? Any help is greatly appreciated. 

3 Replies 3
Honored Contributor

There is mis spelling in API for messages.id

Your query should be 

https://www.paypal-community.com/api/2.0/search?q=SELECT * FROM labels WHERE messages.id='745517'

 

Try this, and check if its working for you now.

.......
Do you know we work with Kudos and Accepted Solution.
Occasional Contributor

Hi Prashant,

I am getting the same error. You can click on the link and check without any oauth. You should be able to see the response in the browser.

Clicking on the first API URL in my original post works but not the second URL (neither does your corrected version). 

Honored Contributor

@abhir,

Check now, Its for me.

https://www.paypal-community.com/api/2.0/search?q=SELECT%20*%20FROM%20labels%20WHERE%20messages.id=%...

Actually i have copied the link from your post, and link address remain same, where i have updated the text in previous post.

.......
Do you know we work with Kudos and Accepted Solution.

Welcome to the Technology board!

Curious about our platform? Looking to connect on social technology? You've come to the right place!

Are you a Khoros customer? For direct assistance from our Support team, please visit the Support Forum.