Search code examples
salesforcesalesforce-lightningsalesforce-communitiessalesforce-service-cloudsimple-salesforce

How to fetch salesforce case details using CaseNumber via API call?


I am trying to fetch salesforce case details using CaseNumber which is currently throwing below error:

[ { "errorCode": "NOT_FOUND", "message": "The requested resource does not exist" } ]

Using CaseNumber

I have tried making GET call using Case with all the parameters required and it works fine. The same does not work with CaseNumber.

Using Case

Can anyone help me on how i can get case details using CaseNumber??

Thanks in advance


Solution

  • CaseNumber is just a field on a Case object (a column in a database table), not a table on its own.

    You either pull all fields (well all... all your user is allowed to see) of a single case with

    /services/data/v59.0/sobjects/Case{id}

    or you run a query

    /services/data/v59.0/query?q=SELECT+Id,CaseNumber,Subject,Description+FROM+Case+WHERE+CaseNumber='00128192'