TeamDesk Knowledge Base & Support

   Home      FAQ      Forum      Idea Exchange      Ask a Question      My Stuff      Help   
  
Call GET method with filter parameter
Hi Team! I need your help...

I'm try call an URL with GET method and "Filter" parameters, this filter include a date, but to call URL I can't add correctly the date format because appear an error message.

URL: /secure/api/v2/{appid}/{table}/select.json?column=RUT%2F%2FCOUNT&filter=%5BRUT%5D%3D%2217575509-8%22%20and%20%5BOTP%5D%3D%22173641%22%20and%20%5BTELEFONO%5D%3D%22%2B56994512175%22and%20%5BRESET%5D%3D2023-05-2510%3A32%3A21

Field date: RESET
Date: 2023-05-25T10:31:21.13-05:00

Error message:
{
"error": 400,
"code": 2002,
"source": "filter",
"message": "Unexpected ':'"
}

Please, if possible share me an example, I'm review the document (https://teamdesk.crmdesk.com/image.aspx?mode=file&id=15884) but not appear nothing.

ID
1992
Category
Integration/API
Author

Francisco Ahumada
Date Created
6/28/2023 9:14:06 AM
Date Updated
6/28/2023 9:27:11 AM
Comments
Slava Shinderov  Staff  6/28/2023 9:20:56 AM
Here you go:
https://www.teamdesk.net/help/13.1.1.aspx

In general, please consider using regular view to construct/test your filter formula.
Pierre 6/28/2023 9:27:11 AM
Hello Francisco

I have struggled just as you do.

The way I do it now is the following:
I create a variable called [Filter], which I build with regular characters, ex (with date):

"[@Fact-HA]<>'"&[DEV@FactHAANePasAllouer]&"' and [@Organisation]='" & [@Organisation] & "' and [@Fournisseur]='" & [@Fournisseur] & "' and [@Société Destinataire (Nous)]='" & [@Nous] & "' and [#Achat]=0 and [Date de Facture]>=#" & Nz(Left(Format([Date de Commande],"s"),10),'2021-01-01') & "# and [Données Facture]='Validé'"

In the call URL, I use this variable and let TeamDesk convert it:
<%*Replace(URLRoot(),"db","api/v2")%>/t_12345678/select.json?column=%40Fact-HA&filter=<%[Filter]%>

Kind regards,

Pierre

Feedback
Back to Search Results