Skip to main content
POST
/
Fetch and Cache Data
curl --request POST \
  --url https://sandbox.apicaching.io/ \
  --header 'Content-Type: application/json' \
  --header 'X-ApiCaching-OriginUrl: <x-apicaching-originurl>' \
  --data '{}'
{}

Headers

X-ApiCaching-Endpoint
string

Your unique project endpoint. This is only required for this example. You should be accessing your unique endpoint directly, instead of the sandbox endpoint. If your endpoint is: https://my-special-endpoint.apicaching.io, set the value of this header to 'my-special-endpoint'.

X-ApiCaching-OriginUrl
string
required

Your origin API URL where you fetch your data from

X-ApiCaching-MaxAge
integer
default:86400

Max age for cache validity in seconds

X-ApiCaching-Swr
integer
default:0

Stale-while-revalidate period in seconds

Body

application/json · object

Response

Data fetched and cached successfully

The response is of type object.

I