Retrieve
Get a list of invitations sorted by date (most recent first)
GET /1.0/invitations.json
Query parameters
They should be passed as query parameters to the URL. (ex.: ?id=1&code=abc
)
id
int (required)
The unique webshop ID.
code
string (required)
Your personal API code.
offset
int
Offset of returned invitations. For example: an offset 10 would result in the 10 newest invitations to be excluded.
order
int
The maximum amount of returned invitations. The range of the variable is 1-100.
Example response
{
"status": "success",
"message": "Invitations successfully retrieved!",
"invitations": [
{
"email": "john.doe@example.com",
"order": "",
"delay": 0,
"datetimes": {
"created": "2022-06-19 14:04:39",
"scheduled": "2022-06-19 14:04:39",
"sent": "2022-06-19 15:34:39"
}
},
{
"email": "jane.doe@example.com",
"order": "5468",
"delay": 2,
"datetimes": {
"created": "2022-06-19 14:04:39",
"scheduled": "2022-06-21 14:04:39",
"sent": false
}
}
]
}
Response statuses
status | message | Explanation |
---|---|---|
success | Invitations successfully retrieved! | |
error | Not all obligated variables are set. | One or more of the required variables (id , code ) has/have not been set. |
error | Incorrect authentication credentials. | The combination id and code is invalid. |
error | Unexpected error while processing. Please contact WebwinkelKeur. | An unexpected error has occurred. This will probably only be solvable by the WebwinkelKeur team. |
Example code
<?php
$id = 1;
$code = '123456789abc123456789';
$offset = 0;
$order = 10;
$curl = curl_init(
sprintf(
'https://dashboard.webwinkelkeur.nl/api/1.0/invitations.json?id=%s&code=%s&offset=%s&order=%s',
$id,
$code,
$offset,
$order,
),
);
curl_setopt_array($curl, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_FOLLOWLOCATION => true,
]);
$response = curl_exec($curl);
if ($response !== false) {
$data = json_decode($response, true);
/*
$data will look similar to the format below:
$data = [
"status" => "success",
"message" => "Invitations successfully retrieved!",
"invitations" => See example
];
*/
} else {
// An error occurred
}