Home      FAQ      Forum      Idea Exchange      Ask a Question      My Stuff      Help   
pull one record from DB using API without Id Field
Still figuring this whole API thing out. I know I can get records based of the record ID but I am trying to get record data with the API filtering on not id field. Not sure the best way to do, but if I read the API documentation if I use the following GET call

https://www.teamdesk.net/secure/api/v2/*****/CSR/List All/select.json?

I get a complete list of all records in the system.

What I am trying to do is to just retrieve one record that has a value of XXX in the field "MachineId".
Note MachineId is not the key field, as I use Id as the key field in many other aspects of the DB.

What I don't see in the Documentation is how to actually filter. It says one of the parameters can be a filter but I see nothing in there on how.

So what I am really asking is there a better way to send a call url to TeamDesk not using record id that can quarry the DB and return just one record that I can then use the response to get the data I need?

Mike Nelson
Date Created
7/18/2019 4:58:48 PM
Date Updated
7/19/2019 3:47:54 AM
Patricio Bustos 7/18/2019 6:20:05 PM
Hi, have you tried with views. You can use selection through views that are previously built. so at least I use it.
Nick Ashcroft 7/19/2019 3:47:54 AM
hi Mike,
the filterin in the API uses the same format as when filtering in a view.

To get a better understanding, make a new view with the filter you want in the 'matching' section of the view. for example select 'MachineId' from the left dropdown then 'is' in the middle then 'xxx' on the right.
Press 'save' and then edit the view again. Click the 'custom formula' radio button and you will see what the formula syntax is for your filter (something like [MachineId]='xxx'). Copy this formula.

go to the 'REST API Playground' from the database setup, run the 'describe app' option, select your target table in the 'method'/'table dropdown the insert the formula into the 'filter' field.

you will then see the filter added into the url with the correct encoding (but may well work without encoding, depending on what tools you are using)

good luck,
Back to Search Results