I’m trying out the API and currently the “/organizations” endpoint together with field selectors. However, I can’t get it to work. The regular endpoint is working, but as soon as I add any field selector the response I get is “Bad Request”. One simple example I’ve tried is /organizations:(id)?..
I found this question on stackoverflow with a similar problem:
I have some questions related to this.
Should I be able to use the organizations endpoint together with field selectors, or is it not supported?
If I’m able to use field selectors, would that speed up response time?
Is it possible to try the field selector on the online API reference page?
Not really on topic, but… The reason I started looking at the field selector was because I find the response time quite slow for the /organizations endpoint. Are there ways for me to reduce time for the response?
Thanks in advance.
- Should I be able to use the organizations endpoint together with field selectors, or is it not supported?
- Yes, you can use field selectors with organizations
- If I’m able to use field selectors, would that speed up response time?
- It will speed up response time if you’re previously using multiple calls to get the same data that you would just get with a field selector
- Is it possible to try the field selector on the online API reference page?
- Not on the reference page as it doesn’t support this, but you could try through Postman or something similar
- Not really on topic, but… The reason I started looking at the field selector was because I find the response time quite slow for the /organizations endpoint. Are there ways for me to reduce time for the response?
- Depends on what you’re doing, but have you tried Webhooks - it might help out with response time?
With the Bad Request, do you have an example of exactly what you’re using? Maybe I can see something wrong?
Thanks for the answer, I appreciate it.
Can you please clarify your answer on question 2? What I wonder is if a single call with field selector for just a few fields would get a shorter response time than a call without setting any field selectors would.
I’m getting the field selector to work in manual tests and I can confirm that the response is faster if I reduce the number to fields to select.
I’ll reach out if I’m not able to solve the issues in my code. Thanks once again.
Glad it’s working for you and yes, the results you’re seeing should be correct. I had to double-check as the field selector might jump around between tables enough that would slow up response, but all fields would likely be slightly slower since you’ll have to download more data.
Unfortunately I haven’t been able to solve my initial problem. I’m running ASP.NET using IIS and it appears that having a colon before the query string in the url is not valid syntax, hence the response I’m getting is 400 Bad Request. I would actually suggest a change of the field selector syntax used in the API. Not only because it’s not working for me, but since it appears to be a bad syntax to use in an API.
Meanwhile I have to look for a workaround. While testing I’ve noticed that the response time is heavily reduced if only requesting the fields needed, so I’m determined to get to use it.
I can certainly see your point on that and I’ll discuss it with some of our developers. It does although work according to RFC: https://tools.ietf.org/html/rfc3986#appendix-A
For absolute paths, path just contains segment, which contain pchar symbols, which can contain colons
Yes, you’re right. It’s valid according to the RFC. I agree it should be ok. It’s just unfortunate that Microsoft appears to disallow it in some cases.
If anyone can help me out with a workaround here, please let me know.