[SalesForce] Does API calls to Apex REST service published on a public Force.com site come under Daily API Limit

I have a public Force.com site without any pages. I have created a APEX REST service and added it to the force.com site. So the APEX REST service will be accessible public without authentication. All of these developed in a developer org.

I am looking for the following confirmation:

  1. As there are no pages in the site and only APEX REST API, will the page view limit for a force.com site still apply? Or is the response (JSON) considered as a page view

  2. How do I calculate the bandwidth & Request time estimates for the API?

  3. As the force.com site is accessed using guest user license and the APEX REST service is public, does the concurrent API request limit (25) still apply? I guess not.

  4. There are daily API limits on an organization. Does the API requests on the public Force.com site hosted REST Service get included under this?

  5. I used Force.com REST API to get an attachment over 5 MB and it returned the response without error. Is the 3 MB request/response limit not applicable to Salesforce REST API? Is it then applicable for the public APEX REST Service exposed via the public force.com site?

Appreciate any input/direction in this regard to clarify/confirm my above understanding/query.

Best Answer

I built a similar service some time ago, and made some similar verifications and tests, I can provide some answers as follows:

  1. Any request for 'Your Domain" will count as a page view, see docs
  2. You can test the service from runscope (or similar), to get real request times. For example, I have a similar service that performs a SOQL & DML to a single contact record (on a dev org), the round trip averages at 630ms.
  3. Yes, this is still an API call and so the limit will apply. You will need to asses the likely hood of hitting this limit based on your knowledge of the service, frequency of calls to it and the average response time tests from runscope. If your service responds instantly there is much less chance of hitting this limit than if your service completes some complex apex perhaps including SOQL and DML before responding seconds later. (see dev blog article)
  4. Yes, each call to this public site RestResource will consume 1 API request. I have tested this.
  5. The docs here clearly state the 3mb request/response limit does apply, although this does not explain your tests. However perhaps an exception is made around attachments as these clearly do transport successfully via API (e.g. with force.com dataloader over soap or dataloader.io over soap & rest and many other integration tools).
Related Topic