Collect a logs export
Answers the file of a ready export, once: CSV or one JSON object a line, not a JSON document. Send the capability the start answered; once the file has been collected, or after 24 hours, the answer is 410.
POST/ api/ corestack/ logs/ exports/ {download}/ collect
Path parameters
downloadstringRequired
The id of an export, as its start answered it. 26 characters.
Body
capabilitystringRequired
The capability the export's start answered. Up to 128 characters.
Returns
200 The file. It can be collected once.
Fields of the 200 answer
If it is refused
| Status | Reason | What to do |
|---|---|---|
401 | none | Send a valid token as Authorization: Bearer <token>. |
403 | company_unavailable | Your company is unavailable. |
403 | scope_required | Use a token with the scope named in scope. |
403 | two_factor_required | Turn on two-factor on your account, then send again. |
404 | feature_off | This feature is not on for your organisation yet. |
409 | download_preparing | The download is still being prepared. |
410 | expired | The link, recording or transfer has expired. Start again. |
422 | invalid | Fix the field named in field; errors says why. |
429 | rate_limited | Wait for the seconds in Retry-After. |
Reasons are listed by name in Errors and refusals.
The same task elsewhere
curl -X POST https://manage.corefinity.com/api/corestack/logs/exports/01JB2Y8N7Q4X3R5T6V8W9Z0A1B/collect \
-H "Authorization: Bearer $COREFINITY_TOKEN" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{
"capability": "Example-export-capability-0000000000000000000001"
}'use Illuminate\Support\Facades\Http;
$response = Http::withToken(env('COREFINITY_TOKEN'))
->acceptJson()
->post('https://manage.corefinity.com/api/corestack/logs/exports/01JB2Y8N7Q4X3R5T6V8W9Z0A1B/collect', [
'capability' => 'Example-export-capability-0000000000000000000001',
]);
$data = $response->json();const res = await fetch('https://manage.corefinity.com/api/corestack/logs/exports/01JB2Y8N7Q4X3R5T6V8W9Z0A1B/collect', {
method: 'POST',
headers: {
Authorization: `Bearer ${process.env.COREFINITY_TOKEN}`,
Accept: 'application/json',
'Content-Type': 'application/json',
},
body: JSON.stringify({
capability: 'Example-export-capability-0000000000000000000001',
}),
});
// An answer with no body (204) has nothing to parse.
const text = await res.text();
const data = text && JSON.parse(text);import os
import requests
res = requests.post(
"https://manage.corefinity.com/api/corestack/logs/exports/01JB2Y8N7Q4X3R5T6V8W9Z0A1B/collect",
headers={
"Authorization": f"Bearer {os.environ['COREFINITY_TOKEN']}",
"Accept": "application/json",
},
json={
"capability": "Example-export-capability-0000000000000000000001",
},
)
data = res.json() if res.content else None"string"{
"message": "Unauthenticated."
}{
"code": "company_unavailable",
"message": "Your company is unavailable.",
"reason": "company_unavailable"
}{
"code": "feature_off",
"message": "Not found.",
"reason": "feature_off"
}{
"code": "download_preparing",
"message": "The download is still being prepared.",
"reason": "download_preparing"
}{
"code": "expired",
"message": "This download has expired. Prepare it again.",
"reason": "expired"
}{
"code": "invalid",
"errors": {
"capability": [
"This download link is not valid."
]
},
"field": "capability",
"message": "This download link is not valid.",
"reason": "invalid"
}{
"code": "rate_limited",
"message": "Too many requests. Try again in 60 seconds.",
"reason": "rate_limited",
"retry_after_seconds": 60
}Try it
Try it is off for this endpointIt deletes data that cannot be brought back. Copy the request and run it yourself when you are sure.
Was this helpful?