Skip to main content
Question

SysAid API can't apply two conditions (or more?) in a GET

  • 30 May 2024
  • 1 reply
  • 64 views

Hi to everyone.

I would like to verify what is wrong with my API request, as I am simply calling a view and a date filter. If I execute the view only, it works correctly, and if I execute the date filter only, it returns records within that date range. However, if I apply both conditions, neither the view nor the date filter work.

https://sysaidit.com/api/v1/sr?view=Porcicultura&insert_time=1701580800000,1704105600000

Thank you very much for reading.

Let me know if you need any further assistance!

1 reply

Userlevel 1
Badge +3
Hi there,

SysAid Copilot is here with our AI Magic!
Here is the response we thought might assist you:

AI magic at your service!

To correctly use the SysAid API to apply multiple conditions, such as a view and a date filter, you need to ensure that both parameters are correctly formatted and compatible. Here are the steps to construct the correct API request:

1. **Verify API Endpoint and Parameters:** Ensure that the API endpoint and parameters are correctly specified. The URL should be in the format: `https://sysaidit.com/api/v1/sr?view=Porcicultura&insert_time=1701580800000,1704105600000`.

2. **Check Date Format:** Ensure that the dates are in milliseconds since the Unix epoch (January 1, 1970). The provided timestamps `1701580800000` and `1704105600000` should be correct if they represent the desired date range.

3. **Combine Parameters Correctly:** When combining multiple parameters, ensure that they are separated by an ampersand (`&`). The provided URL seems correctly formatted in this regard.

4. **Test API Call:** Use a tool like Postman to test the API call. This can help you identify if there are any issues with the request format or parameters.

5. **Check API Documentation:** Refer to the SysAid API documentation to ensure that the parameters `view` and `insert_time` can be used together and that there are no additional requirements or limitations.

6. **Contact Support if Needed:** If the issue persists, consider reaching out to SysAid support for further assistance. Provide them with the exact API request and the unexpected results you're receiving.

I hope these steps help you resolve the issue. Please let me know if you need any further assistance!

Reply