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-ApiKey: <api-key>' \
  --header 'X-ApiCaching-OriginUrl: <x-apicaching-originurl>' \
  --data '{}'
{}

Authorizations

X-ApiCaching-ApiKey
string
header
required

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

The body is of type object.

Response

Data fetched and cached successfully

The response is of type object.