Built-In Logical Units APIs

Fabric provides out-of-the-box web services APIs for querying a project's LU data and metadata resources.

An appropriate HTTP status code is used to indicate the status of the executed operation, following standardized status codes that are defined by [RFC7231] and listed in the IANA Status Code Registry.

Any web-service call passes authentication and authorization validations before being executed. For more information - see here.

All API accesses are over HTTPS, and are accessed from the Fabric URL endpoint https://<Domain Name>:<PORT>

Get LU Schema (Metadata)

GET /api/lu/<LU Name>[?format=json|xml]

Component

Description

Mandatory

Example

Default

LU Name

Logical unit name

Y

CUSTOMER

 

Format

Response format

N

JSON/XML

JSON

 

Examples:

  • https://localhost:3213/api/lu/CUSTOMER

    Brings metadata for CUSTOMER LU

Get LU Data

Retrieves either the whole LUI data or a specific LUI table

GET /api/lu/<LU Name>/<iid>/[<TABLE NAME>][?fields=<VALUE1,VALUE2>][&where=<WHERE STATEMENT>][&query=<QUERY STATMENT>][&limit=<Number of rows to get>][&set={mode,value}][&format=json|xml]

Component

Description

Mandatory

Example

Default

LU Name

Logical unit name

Y

CUSTOMER

 

iid

Instance ID

Y

1

 

TABLE NAME

The LU table name

N

PAYMENT

When omitted, retrieves all tables data

fields

Specify specific fields to be retrieved

N

fields=CUSTOMER_ID, INVOICE_ID

When omitted, all fields are retrieved

where

Where statement for the selected table

N

where=NAME=’MOSHE’ OR ADDRESS=’TEL AVIV’

Can be populated if FIELDS are populated

QUERY

Where statement for cross LU tables on the same LU

N

QUERY=SELECT NAME from ADDRESS_DATA A,ADDRESS_NAME_LINK B WHERE A.ADDRESS_ID =B.ADDRESS_ID

 

set

Sync mode

N

set=sync,off SET=sync,on SET=sync,force

Sync policy on the session

 set

Environment

N

set=ENVIRONMENT,’ENV1’

_dev

 set

Sync_timeout

N

set=SYNC_TIMEOUT,10

Set on config.ini

 set

instance_ttl

N

set=instance_ttl,10

 
set Environment variable

N

set=A,4

 

format

Response format

N

JSON or XML

JSON

limit

Number of rows to get per retrieved table

N

2

JSON

 

Examples:

  • https://localhost:3213/api/lu/CUSTOMER/1

    Brings all data for CUSTOMER LU Instance ID 1

    Response Body: response body supports streaming solution

  • https://localhost:3213/api/lu/CUSOMTER/1/ALLERGIES

    Brings data for CUSTOMER LU Instance ID 1, table ALLERGIES

  • https://localhost:3213/api/lu/CUSTOMER/1/PAYMENT?fields=PAYMENT_ID,PAYMENT_DATE&where=PAYMENT_STATUS!=’CLOSED’

    Brings data for CUSTOMER LU Instance ID 1, table PAYMENT, fields PAYMENT_ID, PAYMENT_DATE where payments are not closed.

  • https://localhost:3213/api/lu/CUSTOMER/1?query=SELECT FIRST_NAME FROM ADDRESS_DATA A, ADDRESS_NAME_LINK B WHERE A.ADDRESS_ID =B.ADDRESS_ID AND B.ADDRESS_TYPE=’P’

    Brings data for CUSTOMER LU Instance ID 1, table ADDRESS_DATA field FIRST_NAME where name type is private.

  • https://localhost:3213/api/lu/CUSTOMER/1?query=SELECT FIRST_NAME FROM ADDRESS_DATA A,ADDRESS_NAME_LINK B WHERE A.ADDRESS_ID =B.ADDRESS_ID AND B.ADDRESS_TYPE=’P’&set=sync,force&set=ENVIRONMENT,ENV1&set=GLOBAL_LOCATION_ACCURACY,10

    Brings data for CUSTOMER LU Instance ID 1, table ADDRESS_DATA field FIRST_NAME where name type is private. Make sure sync mode is force and run it on ENV1 and set GLOBAL_LOCATION_ACCURACY to 10.

Create LU Table Data

POST /api/lu/<LU Name>/<iid>/[[<TABLE-NAME>][?format=json/xml]

Component Description Mandatory Example Default
LU Name Logical unit name Y CUSTOMER COMMON  
Iid Instance ID Y 1  
TABLE NAME Table names to post data into N    
format Response format N JSON/XML JSON

Example:

  1. Inserts data into CUSTOMER LU instance id 1, SUBSCRIBER table, where table name is specified at the post body https://10.21.1.69:3213/api/v1.0/lu/CUSTOMER/1 Request Body:

    {"rows":{"SUBSCRIBER ":[{"ID":11, "NAME":"John Smith"},{"ID":12,"NAME":"Laura Smith"},{"ID":13,"NAME":"Dan Smith"}]}}
    
  2. Inserts data into CUSTOMER LU instance id 1, SUBSCRIBER table, where table name is specified at URL

    https://10.21.1.69:3213/api/v1.0/lu/CUSTOMER/1/SUBSCRIBER Request Body:

   {"rows":[{"ID":11, "NAME":"John Smith"},{"ID":12,"NAME":"Laura Smith"},{"ID":13,"NAME":"Dan Smith"}]}

Update LU Table Data

PUT /api/lu/<LU Name>/<iid>/[TABLE NAME][?format=json|xml]

Component Description Mandatory Example Default
LU Name Logical unit name or COMMON for common tables Y CUSTOMER  
iid Instance Id Y 1  
TABLE NAME Table name for data creation Y PAYMENT  
format Response format N JSON/XML/CSV JSON

The request body shall contain the row data to be updated along with an optional 'where' element, as the where condition statement.

Example:

  • https://localhost:3213/api/v1.0/lu/CUSTOMER/1/INVOICE

    Updates data on CUSTOMER LU instance id 1, CUSTOMER table

    Request Body

 {
    "row" : {"LAST_NAME":"TEST1"},
    "where":"CUSTOMER=1 or ADDRESS='Betsey'"
}                    

Delete LUI

DELETE /api/lu/<LU Name>/iid[?format=json/xml]

Component Description Mandatory Example Default
LU Name Logical unit name or COMMON for common tables Y PATIENT COMMON  
iid Instance Id Y 1  
Format Response format N JSON/XML JSON

Example:

  • https://localhost:3213/api/lu/PATIENT

    Deletes LUI 1 from PATIENT LU

Delete Data From LU Table

DELETE /api/lu/<LU Name>/iid/<TABLE_NAME>?where=<WHERE STATEMENT>][&format=json|xml]

Component Description Mandatory Example Default
LU name Logical unit name Y PATIENT  
Iid Instance Id Y 1  
TABLE NAME Table name for data deletion Y PAYMENT  
WHERE STATEMENT Where clause statement Y INVOICE_ID=1  
format Response format Y JSON/XML JSON

Example:

  • https://localhost:3213/api/lu/PATIENT/1/INVOICE?WHERE=CUSTOMER=1 or NAME=’John Smith’

    Deletes data from PATIENT LU instance id 1, INVOICE table by using a 'where' clause

Previous

Built-In Logical Units APIs

Fabric provides out-of-the-box web services APIs for querying a project's LU data and metadata resources.

An appropriate HTTP status code is used to indicate the status of the executed operation, following standardized status codes that are defined by [RFC7231] and listed in the IANA Status Code Registry.

Any web-service call passes authentication and authorization validations before being executed. For more information - see here.

All API accesses are over HTTPS, and are accessed from the Fabric URL endpoint https://<Domain Name>:<PORT>

Get LU Schema (Metadata)

GET /api/lu/<LU Name>[?format=json|xml]

Component

Description

Mandatory

Example

Default

LU Name

Logical unit name

Y

CUSTOMER

 

Format

Response format

N

JSON/XML

JSON

 

Examples:

  • https://localhost:3213/api/lu/CUSTOMER

    Brings metadata for CUSTOMER LU

Get LU Data

Retrieves either the whole LUI data or a specific LUI table

GET /api/lu/<LU Name>/<iid>/[<TABLE NAME>][?fields=<VALUE1,VALUE2>][&where=<WHERE STATEMENT>][&query=<QUERY STATMENT>][&limit=<Number of rows to get>][&set={mode,value}][&format=json|xml]

Component

Description

Mandatory

Example

Default

LU Name

Logical unit name

Y

CUSTOMER

 

iid

Instance ID

Y

1

 

TABLE NAME

The LU table name

N

PAYMENT

When omitted, retrieves all tables data

fields

Specify specific fields to be retrieved

N

fields=CUSTOMER_ID, INVOICE_ID

When omitted, all fields are retrieved

where

Where statement for the selected table

N

where=NAME=’MOSHE’ OR ADDRESS=’TEL AVIV’

Can be populated if FIELDS are populated

QUERY

Where statement for cross LU tables on the same LU

N

QUERY=SELECT NAME from ADDRESS_DATA A,ADDRESS_NAME_LINK B WHERE A.ADDRESS_ID =B.ADDRESS_ID

 

set

Sync mode

N

set=sync,off SET=sync,on SET=sync,force

Sync policy on the session

 set

Environment

N

set=ENVIRONMENT,’ENV1’

_dev

 set

Sync_timeout

N

set=SYNC_TIMEOUT,10

Set on config.ini

 set

instance_ttl

N

set=instance_ttl,10

 
set Environment variable

N

set=A,4

 

format

Response format

N

JSON or XML

JSON

limit

Number of rows to get per retrieved table

N

2

JSON

 

Examples:

  • https://localhost:3213/api/lu/CUSTOMER/1

    Brings all data for CUSTOMER LU Instance ID 1

    Response Body: response body supports streaming solution

  • https://localhost:3213/api/lu/CUSOMTER/1/ALLERGIES

    Brings data for CUSTOMER LU Instance ID 1, table ALLERGIES

  • https://localhost:3213/api/lu/CUSTOMER/1/PAYMENT?fields=PAYMENT_ID,PAYMENT_DATE&where=PAYMENT_STATUS!=’CLOSED’

    Brings data for CUSTOMER LU Instance ID 1, table PAYMENT, fields PAYMENT_ID, PAYMENT_DATE where payments are not closed.

  • https://localhost:3213/api/lu/CUSTOMER/1?query=SELECT FIRST_NAME FROM ADDRESS_DATA A, ADDRESS_NAME_LINK B WHERE A.ADDRESS_ID =B.ADDRESS_ID AND B.ADDRESS_TYPE=’P’

    Brings data for CUSTOMER LU Instance ID 1, table ADDRESS_DATA field FIRST_NAME where name type is private.

  • https://localhost:3213/api/lu/CUSTOMER/1?query=SELECT FIRST_NAME FROM ADDRESS_DATA A,ADDRESS_NAME_LINK B WHERE A.ADDRESS_ID =B.ADDRESS_ID AND B.ADDRESS_TYPE=’P’&set=sync,force&set=ENVIRONMENT,ENV1&set=GLOBAL_LOCATION_ACCURACY,10

    Brings data for CUSTOMER LU Instance ID 1, table ADDRESS_DATA field FIRST_NAME where name type is private. Make sure sync mode is force and run it on ENV1 and set GLOBAL_LOCATION_ACCURACY to 10.

Create LU Table Data

POST /api/lu/<LU Name>/<iid>/[[<TABLE-NAME>][?format=json/xml]

Component Description Mandatory Example Default
LU Name Logical unit name Y CUSTOMER COMMON  
Iid Instance ID Y 1  
TABLE NAME Table names to post data into N    
format Response format N JSON/XML JSON

Example:

  1. Inserts data into CUSTOMER LU instance id 1, SUBSCRIBER table, where table name is specified at the post body https://10.21.1.69:3213/api/v1.0/lu/CUSTOMER/1 Request Body:

    {"rows":{"SUBSCRIBER ":[{"ID":11, "NAME":"John Smith"},{"ID":12,"NAME":"Laura Smith"},{"ID":13,"NAME":"Dan Smith"}]}}
    
  2. Inserts data into CUSTOMER LU instance id 1, SUBSCRIBER table, where table name is specified at URL

    https://10.21.1.69:3213/api/v1.0/lu/CUSTOMER/1/SUBSCRIBER Request Body:

   {"rows":[{"ID":11, "NAME":"John Smith"},{"ID":12,"NAME":"Laura Smith"},{"ID":13,"NAME":"Dan Smith"}]}

Update LU Table Data

PUT /api/lu/<LU Name>/<iid>/[TABLE NAME][?format=json|xml]

Component Description Mandatory Example Default
LU Name Logical unit name or COMMON for common tables Y CUSTOMER  
iid Instance Id Y 1  
TABLE NAME Table name for data creation Y PAYMENT  
format Response format N JSON/XML/CSV JSON

The request body shall contain the row data to be updated along with an optional 'where' element, as the where condition statement.

Example:

  • https://localhost:3213/api/v1.0/lu/CUSTOMER/1/INVOICE

    Updates data on CUSTOMER LU instance id 1, CUSTOMER table

    Request Body

 {
    "row" : {"LAST_NAME":"TEST1"},
    "where":"CUSTOMER=1 or ADDRESS='Betsey'"
}                    

Delete LUI

DELETE /api/lu/<LU Name>/iid[?format=json/xml]

Component Description Mandatory Example Default
LU Name Logical unit name or COMMON for common tables Y PATIENT COMMON  
iid Instance Id Y 1  
Format Response format N JSON/XML JSON

Example:

  • https://localhost:3213/api/lu/PATIENT

    Deletes LUI 1 from PATIENT LU

Delete Data From LU Table

DELETE /api/lu/<LU Name>/iid/<TABLE_NAME>?where=<WHERE STATEMENT>][&format=json|xml]

Component Description Mandatory Example Default
LU name Logical unit name Y PATIENT  
Iid Instance Id Y 1  
TABLE NAME Table name for data deletion Y PAYMENT  
WHERE STATEMENT Where clause statement Y INVOICE_ID=1  
format Response format Y JSON/XML JSON

Example:

  • https://localhost:3213/api/lu/PATIENT/1/INVOICE?WHERE=CUSTOMER=1 or NAME=’John Smith’

    Deletes data from PATIENT LU instance id 1, INVOICE table by using a 'where' clause

Previous