APIDocs

Create CriticalCSS

POST /cpress/v1/criticalcss

Additional Headers
Parameter
Type
Optional/Default
Description
Token
token
Auth-Token

Additional Parameters

No Params


Request Body
Parameter
Type
Optional/Default
Description
endpoint
endpoint
valid url to create css for
target
target
valid url to send css to
target_body
target_body
{}
body to forward
target_header
target_header
[]
header to forward

Example Responses
Status: 201
Parameter
Type
Optional
Description
msg
string
Message

Status: 400
Parameter
Type
Optional
Description
msg
string
Error message


Example Requests

curl -X POST http://example.com/cpress/v1/criticalcss \ -H "Content-Type: application/json" \ -H "Content-Length: 125" \ -d {"endpoint":"http:\/\/example.com\/endpoint","target":"http:\/\/example.com\/target","target_body":"{}","target_header":"[]"} \

$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'http://example.com/cpress/v1/criticalcss'); curl_setopt($ch, CURLOPT_POSTFIELDS, {"endpoint":"http:\/\/example.com\/endpoint","target":"http:\/\/example.com\/target","target_body":"{}","target_header":"[]"}); curl_setopt($ch, CURLOPT_POST, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_VERBOSE, 0); curl_setopt($ch, CURLOPT_HTTPHEADER, [ "Content-Type: application/json", "Content-Length: 125", ]); $response = curl_exec($ch);

import requests url = 'http://example.com/cpress/v1/criticalcss' body = {"endpoint":"http:\/\/example.com\/endpoint","target":"http:\/\/example.com\/target","target_body":"{}","target_header":"[]"} headers = {"Content-Type":"application\/json","Content-Length":125} req = requests.post(url, json = body, headers = headers)

Retrieve CriticalCSS

GET /cpress/v1/criticalcss

After Generation was successfull, you can retrieve the content of the generated css with this call

Additional Headers
Parameter
Type
Optional/Default
Description
Token
token
Auth-Token

Additional Parameters
Parameter
Type
Optional/Default
Description
process_id
process_id
ID of the process

Request Body

No Body


Example Responses
Status: 200
Parameter
Type
Optional
Description
CSS
text/css
The Content of the css – This is NO JSON Response but plain css

Status: 400
Parameter
Type
Optional
Description
msg
string
Error message

Status: 404
Parameter
Type
Optional
Description
msg
string
Error message


Example Requests

curl -X GET http://example.com/cpress/v1/criticalcss?process_id=112358132 \ -H "Content-Type: application/json" \

$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'http://example.com/cpress/v1/criticalcss?process_id=112358132'); curl_setopt($ch, CURLOPT_HTTPGET, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_VERBOSE, 0); curl_setopt($ch, CURLOPT_HTTPHEADER, [ "Content-Type: application/json", ]); $response = curl_exec($ch);

import requests url = 'http://example.com/cpress/v1/criticalcss?process_id=112358132' body = {"endpoint":"http:\/\/example.com\/endpoint","target":"http:\/\/example.com\/target","target_body":"{}","target_header":"[]"} headers = {"Content-Type":"application\/json"} req = requests.get(url, headers = headers)

List Processes

GET /cpress/v1/processes

List of all processes

Additional Headers
Parameter
Type
Optional/Default
Description
Token
token
Auth-Token

Additional Parameters

No Params


Request Body

No Body


Example Responses
Status: 200
Parameter
Type
Optional
Description
processes
array
List of all processes


Example Requests

curl -X GET http://example.com/cpress/v1/processes \ -H "Content-Type: application/json" \

$ch = curl_init(); curl_setopt($ch, CURLOPT_URL, 'http://example.com/cpress/v1/processes'); curl_setopt($ch, CURLOPT_HTTPGET, 1); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_VERBOSE, 0); curl_setopt($ch, CURLOPT_HTTPHEADER, [ "Content-Type: application/json", ]); $response = curl_exec($ch);

import requests url = 'http://example.com/cpress/v1/processes' body = {"endpoint":"http:\/\/example.com\/endpoint","target":"http:\/\/example.com\/target","target_body":"{}","target_header":"[]"} headers = {"Content-Type":"application\/json"} req = requests.get(url, headers = headers)