NextGen APIs

GET /integration/assets/r1/accounts

Http Verb

GET

Url

/integration/assets/r1/accounts

Permissions required

Core Additional Parameters: Edit (fsm.core.additionalparameter.edit)

Customer: View (fsm.core.technicalobject.customer.view)

Organizational Structure Entities: View (fsm.core.structure.view)

Facility Configuration: View (fsm.core.technicalobject.configuration.view)

Resource: View (fsm.core.resource.view)

Last Modified Version

r1

Tech Tags

MULTILANGUAGE-FIELDS

Available Async

No

BPMN Diagram

diagram (16).svg


Business Logic

This Integration API gets an Account with its Address.

One of code or externalCode must be present. If code is provided it has the precedence among the other fields. If externalCode is provided then externalSystemCode becomes mandatory.

System verifies Permission Required and starts the elaboration that is organized in steps.

STEP 1 - External System Validation

System takes Input fields and checks their existence in internal configuration.

API Verb: GET

Resource: External Systems

Input: externalSystemCode

Output: externalSystemId, code, description

If System can obtain the Output fields → continue to next step.

If System can’t obtain the Output fields → responds with error. Elaboration is stopped.

Error Type:

STEP 2 - Account Retrieve

System takes Input fields and checks their existence.

API Verb: GET

Resource: Accounts

Input: {code} OR {externalSystemId, externalCode}

Output: accountId, code, description, fiscalCode, note, birthDate, externalCode, operationCenter, type, extension

If System can obtain the Output fields → continue to next step.

If System can’t obtain the Output fields → responds with error. Elaboration is stopped.

Error Type:

STEP 3 - Operation Center Transcode

System takes Input fields and gets the resource.

API Verb: GET

Resource: Operation Centers

Input: operationCenterId

Output: code, description

If System can obtain the Output fields → continue to next step.

If System can’t obtain the Output fields → responds with error. Elaboration is stopped.

Error Type:

STEP 4 - Account Type Transcode

System takes Input fields and gets the resource.

API Verb: GET

Resource: Account Types

Input: typeId

Output: code, description

If System can obtain the Output fields → continue to next step.

If System can’t obtain the Output fields → responds with error. Elaboration is stopped.

Error Type:

STEP 5 - Address Retrieve

System takes Input fields and retrieve the address of the asset.

API Verb: GET

Resource: Addresses

Input: targetId=<accountId>

Output: description, countrycode, districtCode, municipality, municipalityCode, locality, postalCode, street, streetNumber, streetNumberExtension, floor, lot, staircase, apartment, directions, yCoordinate, xCoordinate, toponym, extension

If System can obtain the Output fields → continue to next step.

If System can’t obtain the Output fields → responds with error. Elaboration is stopped.

Error Type:

STEP 6 - Country Transcode

System takes Input fields and gets the resource.

API Verb: GET

Resource: Countries

Input: countryCode

Output: isoAlpha3Code

If System can obtain the Output fields → continue to next step.

If System can’t obtain the Output fields → responds with error. Elaboration is stopped.

Error Type:

STEP 7 - District Transcode

System takes Input fields and gets the resource.

API Verb: GET

Resource: Districts

Input: districtCode

Output: acronym

If System can obtain the Output fields → continue to next step.

If System can’t obtain the Output fields → responds with error. Elaboration is stopped.

Error Type:

STEP 8 - Contacts Retrieve

System takes Input fields and gets the resource.

API Verb: GET

Resource: Contacts

Input: accountId

Output: code, contact, contactTypeId, extension

If System can obtain the Output fields → continue to next step.

If System can’t obtain the Output fields → responds with error. Elaboration is stopped.

Error Type:

  • Others - see link in Resource

STEP 9 - Contact Information Transcode

The following steps are executed for each Contact retrieved.

STEP 9a - Contact Type Transcode

System takes Input fields and gets the resource.

API Verb: GET

Resource: Contact Types

Input: [contactTypeId]

Output: code, description

If System can obtain the Output fields → continue to next step.

If System can’t obtain the Output fields → responds with error. Elaboration is stopped.

Error Type:

STEP 10 - Meters Retrieve

System takes Input fields and gets the resource.

API Verb: GET

Resource: Meters

Input: accountId

Output: acronym, brandId, productionYear, locationId, meterTypeId, serialNumber, classId, note, active, model, capacity, extension

If System can obtain the Output fields → continue to next step.

If System can’t obtain the Output fields → responds with error. Elaboration is stopped.

Error Type:

  • Others - see link in Resource

STEP 11 - Meter Information Transcode

The following steps are executed for each Meter retrieved.

STEP 11a - Meter Brand Transcode

System takes Input fields and gets the resource.

API Verb: GET

Resource: Meter Brand

Input: [brandId]

Output: code, description

If System can obtain the Output fields → continue to next step.

If System can’t obtain the Output fields → responds with error. Elaboration is stopped.

Error Type:

STEP 11b - Meter Location Transcode

System takes Input fields and gets the resource.

API Verb: GET

Resource: Meter Location

Input: [locationId]

Output: code, description

If System can obtain the Output fields → continue to next step.

If System can’t obtain the Output fields → responds with error. Elaboration is stopped.

Error Type:

STEP 11c - Meter Type Transcode

System takes Input fields and gets the resource.

API Verb: GET

Resource: Meter Type

Input: [meterTypeId]

Output: code, description

If System can obtain the Output fields → continue to next step.

If System can’t obtain the Output fields → responds with error. Elaboration is stopped.

Error Type:

STEP 11d - Meter Class Transcode

System takes Input fields and gets the resource.

API Verb: GET

Resource: Meter Class

Input: [classId]

Output: code, description

If System can obtain the Output fields → elaboration is stopped. See Response payload fields.

If System can’t obtain the Output fields → responds with error. Elaboration is stopped.

Error Type:

Path Parameters

As their name suggests, they are included in the URL path of the endpoint.

Not applicable.

Query String Parameters

Start with a ? and includes parameters listed one after the another separated by &.

Filter

Field

Description

Mandatory

Constraint

1

_language

Language option for the response. It supports the following values: - ALL: Request the server to return every possible translation of the response data. - USER

N

Null or Not Blank

2

_exclude

Allows to specify a subset of data that need to be excluded from the response

N

Null or Not Blank

3

_fields

Allows to specify a subset of data that need to be returned

N

Null or Not Blank

4

externalSystemCode

External System Code

N

Null or Not Blank

5

code

Account Code

N

Null or Not Blank

6

externalCode

Account Code in External System

N

Null or Not Blank

Fields

The parameter _fields allows to choose output fields. More info here How to use APIs: Output fields selection.

Header Parameters

Parameters included in the request headers. Generally, request headers are used to keep authorization parameters.

Default.

Request Body Parameters

Request body parameters are used when clients send data to the API. They are shipped in a JSON Object only in POST, PUT, or PATCH requests.

Not applicable.

Request example

HTML
{baseUrl}/integration/assets/r1/accounts?externalSystemCode=SAP&externalCode=ACC_001

Response documentation

Response payload fields


Field

Field Type

Description

1


id

 

 Id

2


code


 Code

3


description


 Description

4


fiscalCode


 Fiscal Code

5


note

 

 Note

6


birthDate


 Birth Date

7


externalCode

 

 External Code

8


operationCenter

operationCenterObject


9


type



10


externalSystem



11


address



12

contacts

code


Contact Code

13

contact


Contact

14

type

contactTypeObject


15

meters

acronym


Meter Acronym

16

brand

brandObject


17

productionYear


Production Year

18

location

locationObject


19

type

meterTypeObject


20

serialNumber


Serial Number

21

class

classObject


22

note


Note

23

active


Active Flag

24

model


Model

25

capacity


Capacity

operationCenterObject

Field

Description

1

code

Code

2

description

Description

externalSystemObject

Field

Description

1

code

Code

2

description

Description

addressObject

Field

Description

1

description

Description

2

countryIsoAlphaCode

Acronym of Nation (3 letters acronym)

3

districtAcronym

Acronym of District

4

street

Street

5

streetNumber

Street Number

6

streetNumberExtension

Street Number Extension

7

floor

Floor

8

lot

Lot

9

staircase

Staircase

10

apartment

Apartment

11

directions

Directions

12

yCoordinate

Latitude

13

xCoordinate

Longitude

14

postalCode

Postal Code

15

toponym

Toponym

16

municipality

Municipality

17

municipalityCode

Municipality Code

18

locality

Locality

typeObject

Field

Description

1

code

Code

2

description

Description

contactTypeObject

Field

Description

1

code

Code

2

description

Description

brandObject

Field

Description

1

code

Code

2

description

Description

locationObject

Field

Description

1

code

Code

2

description

Description

meterTypeObject

Field

Description

1

code

Code

2

description

Description

classObject

Field

Description

1

code

Code

2

description

Description

Compliant with RFC Standard https://www.rfc-editor.org/rfc/rfc9457.html

Extension fields:

Field

Description

Note

code

Extension member of a Problem Details Object that contains the error code

Only for ERROR

Response example

JSON
{
  "extension": {
    "myFieldName": "myValue"
  },
  "id": 123456,
  "code": "string",
  "description": "string",
  "fiscalCode": "string",
  "note": "string",
  "birthDate": "2024-02-12T14:39:34.843Z",
  "externalCode": "string",
  "operationCenter": {
    "extension": {},
    "code": "OCGAS",
    "description": [
      {
        "lang": "en",
        "value": "Center Gass OC"
      }
    ]
  },
  "type": {
  "extension": {},
  "code": "PW",
    "description": [
      {
        "lang": "en",
        "value": "Power Transformer"
      }
    ]
  },
  "externalSystem": {
    "extension": {},
    "code": "SAP",
    "description": "SAP"
  },
  "address": {
      "extension": {},
      "description": "INITIAL ADDRESS",
      "countryIsoAlphaCode": "IT",
      "districtAcronym": "MI",
      "municipality": "MILANO",
      "municipalityCode": "015146",
      "locality": "MILANO",
      "postalCode": "20161",
      "street": "FRATELLI BELTRAMI",
      "streetNumber": 21,
      "streetNumberExtension": "A",
      "yCoordinate": 0.1,
      "xCoordinate": 0.1,
      "toponym": "VIA"
    },
  "contacts": [
    {
      "extension": {
        "myFieldName": "myValue"
      },
      "code": "cell",
      "contact": "345678888888",
      "type": {
        "code": "PHONE",
        "description": "Phone"
      }
    }
  ],
  "meters": [
    {
      "extension": {
        "myFieldName": "myValue"
      },
      "acronym": "acr",
      "brand": {
        "extension": {},
        "code": "SIEMENS",
        "description": "SIEMENS"
      }, 
      "productionYear": 1987
      "location": {
        "extension": {},
        "code": "2",
        "description": "EXTERNAL"
      },
      "type": {
        "extension": {},
        "code": "2",
        "description": "DIGITAL"
      },
      "serialNumber": "re445666",
      "class": {
        "extension": {},
        "code": "CONV",
        "description": "Converter"
      },
      "note": "note...",
      "active": true
    }
  ]
}
JSON
{
  "type": "about:blank",
  "title": "Not Found",
  "status": 404,
  "detail": "External system string does not exist",
  "instance": "/integration/assets/r1/accounts",
  "code": "IA001_001"
}

 Response error codes