Reporting
Download API definition:
This API is a Technical Preview and is available for testing purposes only. Do not use in production.
patch https://qa-api.bentley.com/insights/reporting/keys/{apiKeyId}

Updates an ApiKey.

Authentication

Requires Authorization header with valid Bearer token for scope itwin-platform.

The ApiKey endpoints cannot be used with access tokens generated using the Try it out feature. Only tokens generated using a registered application are permitted.

For more documentation on authorization and how to get access token visit OAUTH2 Authorization page.

Rate limits

All iTwin Platform API operations have a rate limit. For more documentation on that visit Rate limits and quotas page.

Request parameters

Name
Required?
Description
apiKeyId
Yes

Request headers

Name
Required?
Description
Authorization
Yes

OAuth access token with itwin-platform scope

Accept
Yes

Setting to application/vnd.bentley.itwin-platform.v2+json is recommended.

Request body

ApiKey (update)

Name
Type
Required?
Description
displayName
String
Yes

Name of the ApiKey.

Example

json
{
    "displayName": "iModel Report ApiKey"
}

Response 200 OK

Updated ApiKey successfully.

json
{
    "key": {
        "id": "7abd419f-a01d-483c-9242-eaf98c348fbf",
        "displayName": "iModel Report ApiKey",
        "userEmail": "john.doe@example.com",
        "expiresAt": "2022-09-02T12:03:00.0000000+00:00",
        "_links": {
            "report": {
                "href": "https://api.bentley.com/insights/reporting/reports/3fa85f64-5717-4562-b3fc-2c963f66afa6"
            }
        }
    }
}

Response 401 Unauthorized

This response indicates that request lacks valid authentication credentials. Access token might not been provided, issued by the wrong issuer, does not have required scopes or request headers were malformed.

json
{
    "error": {
        "code": "HeaderNotFound",
        "message": "Header Authorization was not found in the request. Access denied."
    }
}

Response 404 Not Found

Specified ApiKey was not found.

json
{
    "error": {
        "code": "ApiKeyNotFound",
        "message": "Requested ApiKey is not available.",
        "target": "apiKeyId"
    }
}

Response 422 Unprocessable Entity

The 422 (Unprocessable Entity) status code indicates that the request cannot be processed by the server due to a client error (e.g. malformed request syntax)

json
{
    "error": {
        "code": "InvalidInsightsRequest",
        "message": "Cannot update ApiKey.",
        "details": [{
            "code": "InvalidValue",
            "message": "Provided 'displayName' value is not valid. The value cannot be empty or consist only of whitespace characters.",
            "target": "displayName"
        }]
    }
}

Response 429 Too many requests

This response indicates that the client sent more requests than allowed by this API for the current tier of the client.

json
{
    "error": {
        "code": "RateLimitExceeded",
        "message": "The client sent more requests than allowed by this API for the current tier of the client."
    }
}

Response headers

Name
Description
retry-after

Number of seconds to wait until client is allowed to make more requests.

Link

Hyperlink container.

Name
Type
Description
href
String

Hyperlink to the specific entity.

Error

Contains error information.

Name
Type
Description
code
String

One of a server-defined set of error codes.

target
String, null

The target of the error.

message
String

A human-readable representation of the error.

ApiKey

Properties of the retrieved ApiKey.

Name
Type
Description
id
String

The ApiKey Id.

expiresAt
Date-time

ApiKey expiration DateTime.

userEmail
String

Email of the user who created the ApiKey.

displayName
String

Name of the ApiKey.

ApiKey Links

Contains contextual hyperlinks to related data.

Name
Type
Description
report

ApiKey Response

Container for a ApiKey object.

Name
Type
Description

ApiKey (update)

Properties of the ApiKey to be updated.

Name
Type
Description
displayName
String

Name of the ApiKey.

DetailedError

Contains error information and an array of more specific errors.

Name
Type
Description
code
String

One of a server-defined set of error codes.

target
String, null

The target of the error.

details

Optional array of more specific errors.

message
String

A human-readable representation of the error.

Error Response

Gives details for an error that occurred while handling the request. Note that clients MUST NOT assume that every failed request will produce an object of this schema, or that all of the properties in the response will be non-null, as the error may have prevented this response from being constructed.

Name
Type
Description
error

Error information.

Detailed Error Response

Gives details for an error that occurred while handling the request. Note that clients MUST NOT assume that every failed request will produce an object of this schema, or that all of the properties in the response will be non-null, as the error may have prevented this response from being constructed.

Name
Type
Description
error

Error Detailed information.

Was this page helpful?