Publish an offer
curl --request POST \
--url https://coreapi.io/api/offers/{id}/publish \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"recipientIds": [
"<string>"
],
"notifyRecipients": false,
"customMessage": "<string>",
"newRecipients": [
{
"email": "jsmith@example.com",
"firstName": "<string>",
"lastName": "<string>"
}
]
}
'import requests
url = "https://coreapi.io/api/offers/{id}/publish"
payload = {
"recipientIds": ["<string>"],
"notifyRecipients": False,
"customMessage": "<string>",
"newRecipients": [
{
"email": "jsmith@example.com",
"firstName": "<string>",
"lastName": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
recipientIds: ['<string>'],
notifyRecipients: false,
customMessage: '<string>',
newRecipients: [{email: 'jsmith@example.com', firstName: '<string>', lastName: '<string>'}]
})
};
fetch('https://coreapi.io/api/offers/{id}/publish', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://coreapi.io/api/offers/{id}/publish",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'recipientIds' => [
'<string>'
],
'notifyRecipients' => false,
'customMessage' => '<string>',
'newRecipients' => [
[
'email' => 'jsmith@example.com',
'firstName' => '<string>',
'lastName' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"outcome": "PUBLISHED",
"requestId": "<string>"
}Angebote
Publish an offer
Beta. This endpoint is unstable and may still change without notice. Pin against the dated version and watch the changelog.
Freezes the current draft as a version and either publishes it directly or, when an approval workflow matches, opens an approval request. The outcome tells you which happened. Optionally notifies recipients.
POST
/
api
/
offers
/
{id}
/
publish
Publish an offer
curl --request POST \
--url https://coreapi.io/api/offers/{id}/publish \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"recipientIds": [
"<string>"
],
"notifyRecipients": false,
"customMessage": "<string>",
"newRecipients": [
{
"email": "jsmith@example.com",
"firstName": "<string>",
"lastName": "<string>"
}
]
}
'import requests
url = "https://coreapi.io/api/offers/{id}/publish"
payload = {
"recipientIds": ["<string>"],
"notifyRecipients": False,
"customMessage": "<string>",
"newRecipients": [
{
"email": "jsmith@example.com",
"firstName": "<string>",
"lastName": "<string>"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
recipientIds: ['<string>'],
notifyRecipients: false,
customMessage: '<string>',
newRecipients: [{email: 'jsmith@example.com', firstName: '<string>', lastName: '<string>'}]
})
};
fetch('https://coreapi.io/api/offers/{id}/publish', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://coreapi.io/api/offers/{id}/publish",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'recipientIds' => [
'<string>'
],
'notifyRecipients' => false,
'customMessage' => '<string>',
'newRecipients' => [
[
'email' => 'jsmith@example.com',
'firstName' => '<string>',
'lastName' => '<string>'
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}{
"outcome": "PUBLISHED",
"requestId": "<string>"
}Autorisierungen
API token of the organisation. Send it as Authorization: Bearer api_... The token is bound to exactly one organisation.
Pfadparameter
Offer ID (ULID).
Body
application/json
War diese Seite hilfreich?