Skip to content

API reference

What changed in a file an activated mapping no longer fits

Mappings API

POST/v1/mappings/{version}/drift

Send one file and the version of an activated mapping. The answer says whether the mapping still reads the file (stillLoads, the engine’s answer), and which fields are unchanged, renamed, written differently or lost, which columns are new, and a summary. Use it when a file is refused: the answer is the next version’s starting point. Nothing is stored and nothing is validated.

Path parameters

  • versionstringRequired

Request body

application/json, required

  • sampleobjectRequired
    Show 2 child fields
    • namestringRequired
    • datastring (byte)Required

      The file, base64-encoded. At most 10 MB of file, whatever the base64 adds.

Status codes

Status Meaning
200 {drift}: stillLoads, unchanged, renamed, reformatted, lost, shapeLost, newColumns and summary.
400 No sample with a name and its bytes (no_samples), or the mapping says nothing about reading a file (config_reads_no_file).
401 No usable credential was sent (invalid_credentials).
404 This company activated no such mapping (unknown_mapping_config).
413 The file is larger than 10 MB (document_too_large), or holds more than one request may carry once read (file_too_large_to_read).
422 The file cannot be read (unreadable_file), or the profiler cannot profile it (unprofilable_sample).
502 The reader could not run (engine_unavailable). Nothing is wrong with the file.
503 The profiler did not answer (profiler_unavailable).
POST/v1/mappings/{version}/drift
Example
curl -X POST https://api.certinvo.com/v1/mappings/$MAPPING_VERSION/drift \
  -H "Authorization: Bearer $CERTINVO_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary @body.json
import { readFile } from 'node:fs/promises'

const mappingVersion = '1'

const response = await fetch(`https://api.certinvo.com/v1/mappings/${mappingVersion}/drift`, {
  method: 'POST',
  headers: {
    Authorization: `Bearer ${process.env.CERTINVO_API_KEY}`,
    'Content-Type': 'application/json',
  },
  body: await readFile('body.json'),
})
console.log(response.status, await response.json())
import os

import requests

mapping_version = "1"

response = requests.post(
    f"https://api.certinvo.com/v1/mappings/{mapping_version}/drift",
    headers={"Authorization": f"Bearer {os.environ['CERTINVO_API_KEY']}", "Content-Type": "application/json"},
    data=open("body.json", "rb"),
)
print(response.status_code, response.text)
200
No response body.
Success response
POST
/v1/mappings/{version}/drift
What changed in a file an activated mapping no longer fits
All
›AuthenticationRequiredBearerAuth

Provide your API key in the Authorization: Bearer <key> header. Keys are stored locally in your browser.

›Variables1
›Headers2
›Bodyapplication/json
›Code Snippet
curl -X POST "https://api.certinvo.com/v1/mappings/{version}/drift" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "sample": {
    "name": "string",
    "data": "string"
  }
}...'
Response

No request sent yet

Configure parameters and click Send to view the response.

Navigation

Type to search…

↑↓ navigate↵ selectEsc close