Mappings

A mapping is a custom transformation, translating the source format to a format that can be ingested into CDF. Mappings are written in the Cognite transformation language. For more details see documentation here.

List Mappings

Required capabilities: hostedExtractors:READ

List all mappings in a given project. If more than limit mappings exist, a cursor for pagination will be returned with the response.

Securityoidc-token or oauth2-client-credentials or oauth2-open-industrial-data or oauth2-auth-code
Request
query Parameters
limit
integer [ 1 .. 100 ]
Default: 100

Limits the number of results to be returned. The maximum results returned by the server is 100 even if you specify a higher limit.

cursor
string

Cursor for paging through results. In general, if a response contains a nextCursor property, it means that there may be more results, and you should pass that value as the cursor parameter in the next request.

Note that the cursor may or may not be encrypted, but either way, it is not intended to be decoded. Its internal structure is not a part of the public API, and may change without notice. You should treat it as an opaque string and not attempt to craft your own cursors.

Example: cursor=4zj0Vy2fo0NtNMb229mI9r1V3YG5NBL752kQz1cKtwo
Responses
200

List of mappings and an optional cursor.

400

The response for a bad request.

422

Validation Error

get/hostedextractors/mappings
Request samples
mapping_list = client.hosted_extractors.mappings.list(limit=5)

for mapping in client.hosted_extractors.mappings:
    mapping # do something with the mapping

for mapping_list in client.hosted_extractors.mappings(chunk_size=25):
    mapping_list # do something with the mappings
Response samples
application/json
{
  • "items": [
    ],
  • "nextCursor": "string"
}

Create Mappings

Required capabilities: hostedExtractors:WRITE

Create up to 100 mappings.

Securityoidc-token or oauth2-client-credentials or oauth2-open-industrial-data or oauth2-auth-code
Request
Request Body schema: application/json
required

Mappings to create.

required
Array of objects (Items) [ 1 .. 10 ] characters
Responses
200

List of created mappings

400

The response for a bad request.

422

Validation Error

post/hostedextractors/mappings
Request samples
application/json
{
  • "items": [
    ]
}
Response samples
application/json
{
  • "items": [
    ]
}

Retrieve Mappings

Required capabilities: hostedExtractors:READ

Retrieve a list of up to 100 mappings by their external ID, optionally ignoring unknown IDs.

Securityoidc-token or oauth2-client-credentials or oauth2-open-industrial-data or oauth2-auth-code
Request
header Parameters
cdf-version
string (Cdf-Version)
Request Body schema: application/json
required

List of external IDs of mappings to retrieve.

required
Array of objects (Items) [ 1 .. 100 ] items
ignoreUnknownIds
boolean (IgnoreUnknownIds)

Ignore IDs and external IDs that are not found

Responses
200

List of retrieved mappings.

400

The response for a bad request.

422

Validation Error

post/hostedextractors/mappings/byIds
Request samples
application/json
{
  • "items": [
    ],
  • "ignoreUnknownIds": true
}
Response samples
application/json
{
  • "items": [
    ]
}

Delete Mappings

Required capabilities: hostedExtractors:WRITE

Delete a list of mappings by their external ID. This operation will fail if any mapping in the request is associated with a job, unless the force query parameter is set to true.

Securityoidc-token or oauth2-client-credentials or oauth2-open-industrial-data or oauth2-auth-code
Request
Request Body schema: application/json
required

List of external IDs of mappings to delete.

required
Array of objects (Items) [ 1 .. 100 ] items
ignoreUnknownIds
boolean (IgnoreUnknownIds)

Ignore IDs and external IDs that are not found.

force
boolean (Force)

Delete any jobs associated with each item.

Responses
200

Empty response

400

The response for a bad request.

422

Validation Error

post/hostedextractors/mappings/delete
Request samples
application/json
{
  • "items": [
    ],
  • "ignoreUnknownIds": true,
  • "force": true
}
Response samples
application/json
{ }

Update Mappings

Required capabilities: hostedExtractors:WRITE

Update up to 100 mappings.

Securityoidc-token or oauth2-client-credentials or oauth2-open-industrial-data or oauth2-auth-code
Request
Request Body schema: application/json
required

Mappings to update.

required
Array of objects (Items) [ 1 .. 10 ] items
Responses
200

List of updated mappings.

400

The response for a bad request.

422

Validation Error

post/hostedextractors/mappings/update
Request samples
application/json
{
  • "items": [
    ]
}
Response samples
application/json
{
  • "items": [
    ]
}