3

We have custom apex rest service, this service will be called by external application in regular time intervals(assume every 1 minute) which is causing high api hits to salesforce in a 24 hour time frame.

Composite api majorly works by combining multiple requests and making one api call. When i try to call the custom rest service from composite batch api, i'm getting an error saying 'The requested resource does not exist'.

So my question is , Can we call custom apex rest service from composite API?

{
    "batchRequests" : [
        {
            "method" : "POST",
            "url" : "/services/apexrest/(restresourcename)/",
            "richInput" : {
                "param" :"value",
            }
        }
    ]
}
3
  • What is your Apex API doing that it needs to be called every minute? Sep 29, 2021 at 18:28
  • we are doing some calculations on data and responding back.
    – pmr
    Sep 30, 2021 at 8:04
  • I guess what I am trying to understand is why does it have to be every minute? Sep 30, 2021 at 14:33

1 Answer 1

3

The Composite API does not support custom apex REST endpoints, unfortunately. Here are the APIs that are currently supported:

Composite is supported for the following resources.

  • All sObject resources (vXX.X/sobjects/), including sObject Rows by External ID
  • The Query resource (vXX.X/query/?q=soql)
  • The QueryAll resource (vXX.X/queryAll/?q=soql)
  • The sObject Collections resource (vXX.X/composite/sobjects). Available in API version 43.0 and later.

https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_composite_composite.htm

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .