Calls without X-API-Key need no key. Calls with it need a paid plan — get a key.
Get an API key
Free tier, no form to fill in. Signing in shares your email address with us — we
store it to create your key and to recognise you if you sign in with another
provider. By signing up you are subscribing to the APIs.io and API Evangelist
newsletters — you can unsubscribe from any issue. See our
Privacy Policy and Terms.
openapi: 3.2.0
info:
version: '1.0'
title: FIWARE-NGSI v2 Specification Attributes API
description: 'TODO: Add a description'
servers:
- url: http://orion.lab.fiware.org/
tags:
- name: Attributes
paths:
/v2/entities/{entityId}/attrs/{attrName}:
get:
description: 'Returns a JSON object with the attribute data of the attribute. The object follows the JSON
representation for attributes (described in "JSON Attribute Representation" section).
Response:
* Successful operation uses 200 OK.
* Errors use a non-2xx and (optionally) an error payload. See subsection on "Error Responses" for
more details.'
summary: Get attribute data
tags:
- Attributes
operationId: GetAttributeData
parameters:
- name: entityId
in: path
required: true
description: Id of the entity
schema:
type: string
- name: attrName
in: path
required: true
description: Name of the attribute to be retrieved.
schema:
type: string
- name: type
in: query
required: false
description: 'Entity type, to avoid ambiguity in case there are several
entities with the same entity id.'
schema:
type: string
- name: metadata
in: query
required: false
description: 'A list of metadata names to include in the response.
See "Filtering out attributes and metadata" section for more detail.'
schema:
type: string
responses:
'200':
description: ''
content:
application/json:
schema:
$ref: '#/components/schemas/GetAttributeDataResponse'
example:
value: 21.7
type: Number
metadata: {}
x-unitTests:
- request:
method: GET
uri: /v2/entities/Bcn_Welt/attrs/temperature?metadata=accuracy
expectedResponse:
x-allowExtraHeaders: true
x-bodyMatchMode: RAW
x-arrayOrderedMatching: false
x-arrayCheckCount: false
x-matchResponseSchema: true
headers:
Content-Type: application/json
body: '{ "value": 21.7, "type": "Number", "metadata": {}}'
x-testShouldPass: true
x-testEnabled: true
x-testName: Get attribute data1
x-testDescription: "Returns a JSON object with the attribute data of the attribute. The object follows the JSON\nrepresentation for attributes (described in \"JSON Attribute Representation\" section).\nResponse:\n* Successful operation uses 200 OK.\n* Errors use a non-2xx and (optionally) an error payload. See subsection on \"Error Responses\" for\n more details."
x-operation-settings:
CollectParameters: false
AllowDynamicQueryParameters: false
AllowDynamicFormParameters: false
IsMultiContentStreaming: false
x-operation-id-source: normalized
x-operation-id-original: Get attribute data
put:
description: 'The request payload is an object representing the new attribute data. Previous attribute data
is replaced by the one in the request. The object follows the JSON representation for attributes
(described in "JSON Attribute Representation" section).
Response:
* Successful operation uses 204 No Content
* Errors use a non-2xx and (optionally) an error payload. See subsection on "Error Responses" for
more details.'
summary: Update Attribute Data
tags:
- Attributes
operationId: UpdateAttributeData
parameters:
- name: entityId
in: path
required: true
description: Id of the entity to update
schema:
type: string
- name: attrName
in: path
required: true
description: Attribute name
schema:
type: string
- name: Content-Type
in: header
required: true
description: ''
schema:
type: string
- name: type
in: query
required: false
description: 'Entity type, to avoid ambiguity in case there are several
entities with the same entity id.'
schema:
type: string
responses:
'200':
description: ''
x-unitTests:
- request:
method: PUT
uri: /v2/entities/Bcn_Welt/attrs/temperature
headers:
Content-Type: application/json
body: '{ "value": 25.0, "metadata": { "unitCode": { "value": "CEL" } }}'
expectedResponse:
x-allowExtraHeaders: true
x-bodyMatchMode: NONE
x-arrayOrderedMatching: false
x-arrayCheckCount: false
x-matchResponseSchema: true
headers: {}
x-testShouldPass: true
x-testEnabled: true
x-testName: Update Attribute Data1
x-testDescription: "The request payload is an object representing the new attribute data. Previous attribute data\nis replaced by the one in the request. The object follows the JSON representation for attributes\n(described in \"JSON Attribute Representation\" section).\nResponse:\n* Successful operation uses 204 No Content\n* Errors use a non-2xx and (optionally) an error payload. See subsection on \"Error Responses\" for\n more details."
x-operation-settings:
CollectParameters: false
AllowDynamicQueryParameters: false
AllowDynamicFormParameters: false
IsMultiContentStreaming: false
requestBody:
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateAttributeDataRequest'
required: true
x-operation-id-source: normalized
x-operation-id-original: Update Attribute Data
delete:
description: 'Removes an entity attribute.
Response:
* Successful operation uses 204 No Content
* Errors use a non-2xx and (optionally) an error payload. See subsection on "Error Responses" for
more details.'
summary: Remove a Single Attribute
tags:
- Attributes
operationId: RemoveASingleAttribute
parameters:
- name: entityId
in: path
required: true
description: Id of the entity.
schema:
type: string
- name: attrName
in: path
required: true
description: Attribute name.
schema:
type: string
- name: type
in: query
required: false
description: 'Entity type, to avoid ambiguity in case there are several
entities with the same entity id.'
schema:
type: string
responses:
'204':
description: ''
x-unitTests:
- request:
method: DELETE
uri: /v2/entities/Bcn_Welt/attrs/temperature
expectedResponse:
x-allowExtraHeaders: true
x-bodyMatchMode: NONE
x-arrayOrderedMatching: false
x-arrayCheckCount: false
x-matchResponseSchema: true
headers: {}
x-testShouldPass: true
x-testEnabled: true
x-testName: Remove a Single Attribute1
x-testDescription: "Removes an entity attribute.\nResponse:\n* Successful operation uses 204 No Content\n* Errors use a non-2xx and (optionally) an error payload. See subsection on \"Error Responses\" for\n more details."
x-operation-settings:
CollectParameters: false
AllowDynamicQueryParameters: false
AllowDynamicFormParameters: false
IsMultiContentStreaming: false
x-operation-id-source: normalized
x-operation-id-original: Remove a Single Attribute
components:
schemas:
UpdateAttributeDataRequest:
title: Update Attribute Data request
example:
value: 25.0
metadata:
unitCode:
value: CEL
type: object
properties:
value:
description: ''
example: 25
type: number
format: double
metadata:
description: ''
example:
unitCode:
value: CEL
type: object
required:
- value
- metadata
GetAttributeDataResponse:
title: Get attribute data response
example:
value: 21.7
type: Number
metadata: {}
type: object
properties:
value:
description: ''
example: 21.7
type: number
format: double
type:
description: ''
example: Number
type: string
metadata:
description: ''
example: {}
type: object
required:
- value
- type
- metadata
x-provenance:
method: harvested
publisher: FIWARE
source: https://raw.githubusercontent.com/fiware/specifications/HEAD/OpenAPI/ngsiv2/ngsiv2-openapi.json
note: split by refine-openapis from the provider's own published document, verified by fetch (openapi/_original/*.fetch.json);
stamped by stamp-openapi-provenance.py (roadmap#793)