Reference Data
- Last UpdatedJul 12, 2023
- 4 minute read
Rest Asp.net Core controller
Query Reference Data
Queries one or many referenceData entities of a specified TypeId from the Graph Storage.
The response will vary based on the TypeId and if you query for a single entity (by id), or for many entities, or for many entities with paging.
Request
GET /api/v1.0-preview/tenants/{tenantId}/namespaces/{namespaceId}/referencedata
?typeId={typeId}&id={id}&fields={fields}&filter={filter}&orderBy={orderBy}&count={count}&continuationToken={continuationToken}
Parameters
string tenantId
Tenant identifier.string namespaceId
Namespace identifier.string typeId
The referenceData TypeId to query.
[optional] string id
The id of the entntiy to get. If id is specified, then only the fields optional argument will be processed. Also the response JSON will be a single object and not an array.[optional] string fields
The names of the fields to be returned separated by spaces. You can specify simple GraphQL syntax for relationships (ex: asset{id}}. If not specified, it defaults to all non-collection properties.[optional] string filter
The filter to apply to the query.[optional] string orderBy
The order by directive specifies the field name and either ascending (asc) or descending (desc). The default is asc.[optional] integer count
The number of entities to return.[optional] string continuationToken
Specifies you want a page of data with count entities. You must pass an empty token to get the 1st page. The response is different when using paging.
Response
| Status Code | Body Type | Description |
|---|---|---|
| 200 | Inline | Success. |
| 400 | ErrorResponse | Bad Request. See the response body for more details. |
| 404 | ErrorResponse | Not Found. This only applies if an id is specified. |
| 503 | ErrorResponse | Service Unavailable. The service may be loading a new schema. Wait a few seconds and retry. |
Example response body
200 Response
[
{
"id": "critical",
"color": "red",
"severity": 2
},
{
"id": "notice",
"color": "blue",
"severity": 8
}
]
400 Response (ErrorResponse)
{
"reason": "string",
"error": "string",
"resolution": "string",
"data": [
null
],
"childErrors": [
{
"StatusCode": 100,
"Reason": "string",
"Error": "string",
"Resolution": "string",
"Id": "string"
}
]
}
Upsert Reference Data
Upserts one or many referenceData entities of a specified TypeId to the Graph Storage.
If the body contains a JSON array, it upserts many entities. If the body contains a single JSON object it upserts one entity.
The response will reflect the written JSON.
Request
POST /api/v1.0-preview/tenants/{tenantId}/namespaces/{namespaceId}/referencedata
?typeId={typeId}
Parameters
string tenantId
Tenant identifier.string namespaceId
Namespace identifier.string typeId
The referenceData TypeId being added or updated
Request Body
Response
| Status Code | Body Type | Description |
|---|---|---|
| 200 | Inline | OK Result. All entities were upserted. Data is returned. The format of the data will be dependent on the TypeId. |
| 207 | ErrorResponse | MultiStatus Result. Data is returned along with errors. The child errors should have the failed top-level Id and an HttpStatus code. |
| 400 | ErrorResponse | Bad Request. All entities failed to upsert. The child errors should have the failed top-level Id and an HttpStatus code. |
| 413 | Inline | Payload Too Large. The max request body size is 3276800 bytes. |
| 503 | ErrorResponse | Service Unavailable. The service may be loading a new schema. Wait a few seconds and retry. |
Example response body
200 Response
[
{
"id": "critical",
"color": "red",
"severity": 2
},
{
"id": "notice",
"color": "blue",
"severity": 8
}
]
207 Response
{
"Reason": "See child errors",
"Error": "Some of the elements in the request failed.",
"Data": [
{
"id": "critical",
"color": "red",
"severity": 2
}
],
"ChildErrors": [
{
"StatusCode": 412,
"Reason": "OPTIMISTIC_CONCURRENCY_ERROR",
"Error": "Optimistic concurrency error",
"Id": "notice"
}
]
}
400 Response (ErrorResponse)
{
"reason": "string",
"error": "string",
"resolution": "string",
"data": [
null
],
"childErrors": [
{
"StatusCode": 100,
"Reason": "string",
"Error": "string",
"Resolution": "string",
"Id": "string"
}
]
}
Delete Reference Data
Deletes one referenceData entity of a specified TypeId from the Graph Storage.
Request
DELETE /api/v1.0-preview/tenants/{tenantId}/namespaces/{namespaceId}/referencedata
?typeId={typeId}&id={id}
Parameters
string tenantId
Tenant identifier.string namespaceId
Namespace identifier.string typeId
The referenceData TypeId being deleted.string id
The referenceData id to delete.
Response
| Status Code | Body Type | Description |
|---|---|---|
| 204 | Inline | No Content. The entity was deleted. |
| 400 | ErrorResponse | Bad Request. Failed to delete. See the response body for more details. |
| 404 | ErrorResponse | Client or tenant not found. |
| 409 | ErrorResponse | Conflict. Failed to delete because the entity is being referenced by a required relationship. |
| 503 | ErrorResponse | Service Unavailable. The service may be loading a new schema. Wait a few seconds and retry. |
Definitions
ErrorResponse
event response
Properties
| Property Name | Data Type | Required | Nullable | Description |
|---|---|---|---|---|
| reason | string | false | true | reason |
| error | string | false | true | error |
| resolution | string | false | true | resolution |
| data | [any] | false | true | data |
| childErrors | [EventError] | false | true | Child Errors |
{
"reason": "string",
"error": "string",
"resolution": "string",
"data": [
null
],
"childErrors": [
{
"StatusCode": 100,
"Reason": "string",
"Error": "string",
"Resolution": "string",
"Id": "string"
}
]
}
EventError
Event child error
Properties
| Property Name | Data Type | Required | Nullable | Description |
|---|---|---|---|---|
| StatusCode | HttpStatusCode | false | false | status code |
| Reason | string | false | true | reason |
| Error | string | false | true | error |
| Resolution | string | false | true | resolution |
| Id | string | false | true | top level id |
{
"StatusCode": 100,
"Reason": "string",
"Error": "string",
"Resolution": "string",
"Id": "string"
}
HttpStatusCode
Enumerated Values
| Property | Value |
|---|---|
| Continue | 100 |
| SwitchingProtocols | 101 |
| Processing | 102 |
| EarlyHints | 103 |
| OK | 200 |
| Created | 201 |
| Accepted | 202 |
| NonAuthoritativeInformation | 203 |
| NoContent | 204 |
| ResetContent | 205 |
| PartialContent | 206 |
| MultiStatus | 207 |
| AlreadyReported | 208 |
| IMUsed | 226 |
| MultipleChoices | 300 |
| Ambiguous | 300 |
| MovedPermanently | 301 |
| Moved | 301 |
| Found | 302 |
| Redirect | 302 |
| SeeOther | 303 |
| RedirectMethod | 303 |
| NotModified | 304 |
| UseProxy | 305 |
| Unused | 306 |
| TemporaryRedirect | 307 |
| RedirectKeepVerb | 307 |
| PermanentRedirect | 308 |
| BadRequest | 400 |
| Unauthorized | 401 |
| PaymentRequired | 402 |
| Forbidden | 403 |
| NotFound | 404 |
| MethodNotAllowed | 405 |
| NotAcceptable | 406 |
| ProxyAuthenticationRequired | 407 |
| RequestTimeout | 408 |
| Conflict | 409 |
| Gone | 410 |
| LengthRequired | 411 |
| PreconditionFailed | 412 |
| RequestEntityTooLarge | 413 |
| RequestUriTooLong | 414 |
| UnsupportedMediaType | 415 |
| RequestedRangeNotSatisfiable | 416 |
| ExpectationFailed | 417 |
| MisdirectedRequest | 421 |
| UnprocessableEntity | 422 |
| Locked | 423 |
| FailedDependency | 424 |
| UpgradeRequired | 426 |
| PreconditionRequired | 428 |
| TooManyRequests | 429 |
| RequestHeaderFieldsTooLarge | 431 |
| UnavailableForLegalReasons | 451 |
| InternalServerError | 500 |
| NotImplemented | 501 |
| BadGateway | 502 |
| ServiceUnavailable | 503 |
| GatewayTimeout | 504 |
| HttpVersionNotSupported | 505 |
| VariantAlsoNegotiates | 506 |
| InsufficientStorage | 507 |
| LoopDetected | 508 |
| NotExtended | 510 |
| NetworkAuthenticationRequired | 511 |