How to access attached file information via OData

Hello community,

 

I want to get the attached files information from a given case inside my environment. As the primary section containing the information is case, I know that I can retrieve the case information from 

 

https://mycreatio.com/0/odata/Case

 

And the attached files can be extracted from 

 

https://mycreatio.com/0/odata/CaseFile

 

Where each element from the response has the format:

{
  "Id": "7bb283a4-2f30-7193-37f3-79c8465ceda4",
  "Name": "<value>",
  "CreatedOn": "<value>",
  "CreatedById": "<value>",
  "ModifiedOn": "<value>",
  "ModifiedById": "<value>",
  "ProcessListeners": 0,
  ...
  "Size": <value>,
  "CaseId": "<value>",
  "IsNeedToNotify": true,
  "SysFileStorageId": "<value>",
  "FileGroupId": "<value>",
  "Tag": "<value>"
},

As you may see there is a field "CaseId" which is used to link the file object to the case object.

 

The problem I have is that I want to get the list of files from a case only by the Case Id. I've tried many different approaches using the OData standard syntax like:

 

'">https://mycreatio.com/0/odata/CaseFile?$filter=CaseId eq '<value>'

 

But I always get an error when trying to access the resource. In the previous example, the error I get is related to the field data type. Creatio yells because the CaseId field is of type Guid but in the comparison I am using a string.

 

By the way, changing the query to:

 

'">https://mycreatio.com/0/odata/CaseFile?$filter=CaseId eq guid'<value>'

 

or

 

'">https://mycreatio.com/0/odata/CaseFile?$filter=CaseId eq <value>

 

Doesn't fix the issue.

 

Can you please help me with this query that I am struggling to do?

 

Regards

Like 0

Like

1 comments
Best reply

Rather than using CaseId, use Case/Id:

https://mycreatio.com/0/odata/CaseFile?$filter=Case/Id eq idvalue

Ryan

Rather than using CaseId, use Case/Id:

https://mycreatio.com/0/odata/CaseFile?$filter=Case/Id eq idvalue

Ryan

Show all comments