Skip to main content

Hi all,

I am having an issue with the filter directive in the Service Record API call. I have been through the documentation multiple times, used the developer site at https://developers.sysaid.com/reference/searchservicerecords to build the filter. The developer site always seems to throw an error. I have tried just about every imaginable combination of curly braces, square braces, no braces, entered the key:value pair with a colon between and an equal sign in between. I have Googled the syntax, all to no avail. I have a ticket in with the SysAid Help Desk, but they are having issues getting the syntax correct also.

Any suggestions, examples, ideas, will be appreciated.

Bruce

Hi there,

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

copilot-1.png
## Service Record API filter syntax – working examples and gotchas

You’re not alone—filters can be tricky because there are two different APIs in play and each expects a different filter structure. Here’s a concise guide with tested patterns you can try right away.

### 1) New Connect API (recommended)
Endpoint:
- GET https://{account}.sysaidit.com/connect/v1/service-records/search

How to filter:
- Use standard query parameters (no JSON body for filters).
- Common parameters:
- q: free-text search
- fields: comma-separated fields to return
- limit, offset
- orderBy: e.g., "update_time desc"
- For field filters, pass them as query params by name (most fields are supported).

Examples:
- Status = Open (assuming your account uses status captions or IDs—IDs are safer):
- GET …/search?status=1
- Created between two dates (ISO 8601):
- GET …/search?insert_time.gte=2025-09-01T00:00:00Z&insert_time.lt=2025-10-01T00:00:00Z
- Assigned group equals 12 and priority >= 3:
- GET …/search?assigned_group=12&priority.gte=3
- Return only a few fields, ordered by latest update:
- GET …/search?fields=id,title,status,assignee,update_time&orderBy=update_time%20desc&limit=50

Operator suffixes you can use:
- .eq (default if omitted), .ne, .gt, .gte, .lt, .lte, .in (comma-separated), .like (substring), .isnull, .isnotnull

Notes:
- Use field IDs/keys, not captions, when possible (e.g., status=1, not status=Open).
- Date/time must be in UTC (Z). If you provide local times, convert to UTC first.
- If you get 400/422 errors on the dev site, try a minimal query first: …/search?limit=1 and then add filters incrementally.

### 2) Classic API (legacy)
Endpoint:
- GET https://{account}.sysaidit.com/api/v1/sr/search

How to filter:
- Typically uses query and field parameters like:
- query=*
- status=1
- department=5
- Limitations:
- Some custom columns may not be filterable server-side (see below).
- Filtering syntax differs from Connect; operators are limited.

Example:
- Basic:
- GET …/api/v1/sr/search?query=*&status=1&limit=50

Custom fields in Classic:
- Many tenants report that custom columns do not filter server-side and the API returns unfiltered results. Workarounds:
- Fetch the needed set (by date/status/etc.) and filter client-side on the custom field.
- If possible, move to the Connect API where more fields are filterable.

### 3) Common pitfalls
- Mixing APIs: The dev page you used points to Connect v1; ensure your calls match that syntax.
- JSON body vs query string: The Connect search endpoint expects filters as query parameters, not JSON in the body.
- Using captions instead of IDs: Status, category, priority often expect IDs.
- Date formats: Must be ISO 8601 in UTC (e.g., 2025-10-01T00:00:00Z).
- Encoding: URL-encode spaces and special characters (e.g., orderBy=update_time%20desc).
- Custom fields: Not all custom fields are indexed/filterable via API (especially in Classic). Test with a simple known field first.

### 4) Quick templates you can copy
- Last 7 days, open or awaiting, return key fields:
- GET https://{account}.sysaidit.com/connect/v1/service-records/search?status.in=1,2&insert_time.gte=2025-09-24T00:00:00Z&fields=id,title,status,request_user,assigned_group,insert_time&orderBy=insert_time%20desc&limit=100
- Updated since a timestamp:
- GET …/search?update_time.gte=2025-09-30T00:00:00Z&fields=id,title,update_time&orderBy=update_time%20desc
- Filter by assignee email (if supported in your schema) or assignee ID:
- GET …/search?assignee=12345

### 5) If the developer “Try It” tool errors out
- Start with: …/search?limit=1
- Add one filter at a time (e.g., status=1 → then insert_time.gte=…)
- Verify authentication (Bearer token) and that you’re hitting your correct account subdomain.
- Check field availability by retrieving one record and seeing the field names: GET /connect/v1/service-records/{id}

### 6) Share your exact call for a pinpoint fix
If you paste:
- The full URL you’re calling (scrub account name if needed)
- The HTTP method
- The response status/code and body
- One example record showing the field names you want to filter on
…I can adjust the exact syntax for you.

You mentioned a Help Desk ticket already exists, so no need to open another. If you prefer, I can provide a minimal Postman collection snippet for both Connect and Classic to help you validate quickly.

Hi,

This was incredibly helpful. Thank you!

Is there a call which would allow me to retrieve more than 100 service records in a single call? If I want to retrieve all service records from, say, September 2025?

Bruce 


Hi,

Here are the parameters I am passing in the Connect API call…

https://htohh.sysaidit.com/connect/v1/service-records/search?assignedGroup=7,9,10&insertTime.gte2025-02-17T00:00:00Z&fields=id,srType,insertTime,title,requestUser,primaryCategory,secondaryCategory,solution,closeTime,followupText,updateTime,status,priority,dueDate,description,assignedGroup,assignee,responsibleManager,submitUser,updateUser,requestUserManager,timer1,timer2&sort_by=insertTime&sort_dir=desc"

 

This works fine except it only returns 100 service records. I need to return more than that. Is there a call which will allow me to return as many as I need, like everything from August 2025?

I cannot seem to get the legacy call to work yet. I use a very simple call such as what was suggested above…

"https://htohh.sysaidit.com/api/v1/sr/search?query=*&status=1"

It returns - Request failed with status code Unauthorized

Bruce