Using MetaData and CustomData

In Xena apps are able to store two distinct types of data - MetaData and CustomData. MetaData is extra/app-specific data related to a specific entity in Xena. CustomData can be used for almost anything and can act as a kind of small data storage for the app.

Both Meta and Custom data has no predefined structure of the data it stores. What is posted is also what is returned when getting it again. The only requirment is that it is json.

MetaData

For a complete overview of the MetaData methods, please go to https://xena.biz/api-doc/general/#/Developer - ApiXenaAppMetaData

Each app can store its own MetaData related to a specific entity in Xena:

  • fiscalsetup

  • order

  • partner

  • article

  • ledgertag

The MetaData from each app is also indexed so it is searchable. If you need MetaData on other entities then contact us and we might add it.

Each app can only store one instance per entity.

post
Insert MetaData

https://my.xena.biz/Api/Fiscal/{fiscalId}/XenaAppMetaData/{entityType}/{entityId}/{xenaAppId}
Inserts an instance of MetaData. NB: If the instance exists it will be overwritten
Request
Response
Request
Path Parameters
entityType
required
string
The entity type. Supported entity types: fiscalsetup, order, partner, article, ledgertag
entityId
required
long
The entity id
xenaAppId
required
long
The app id
Response
200: OK
OK
Error
OK
{
"Success" = true,
"AssignedId" = "" // {entityType}_{fiscalId}_{entityId}_{xenaAppId}
}
Error
{
"Success" = false,
"Errors" = ["Error1", "Error2"]
}

put
Update MetaData

https://my.xena.biz/Api/Fiscal/{fiscalId}/XenaAppMetaData/{entityType}/{entityId}/{xenaAppId}
Updates an instance of MetaData. NB: If the instance does not exist it will be inserted
Request
Response
Request
Path Parameters
entityType
required
string
The entity type. Supported entity types: fiscalsetup, order, partner, article, ledgertag
entityId
required
long
The entity id
xenaAppId
required
long
The app id
Response
200: OK
OK
Error
OK
{
"Success" = true,
"AssignedId" = "" // {entityType}_{fiscalId}_{entityId}_{xenaAppId}
}
Error
{
"Success" = false,
"Errors" = ["Error1", "Error2"]
}

get
Get MetaData

https://my.xena.biz/Api/Fiscal/{fiscalId}/XenaAppMetaData/{entityType}/{entityId}/{xenaAppId}
Gets a specific MetaData
Request
Response
Request
Path Parameters
entityType
required
string
The entity type. Supported entity types: fiscalsetup, order, partner, article, ledgertag
entityId
required
long
The entity id
xenaAppId
required
long
The app id
Response
200: OK
OK
Error
OK
{ ...The app-specific json body here... }
Error
{
"Success" = false,
"Errors" = ["Error1", "Error2"]
}

CustomData

For a complete overview of the CustomData methods, please go to https://xena.biz/api-doc/general/#/Developer - ApiXenaCustomData

Each app can store one or more custom data instances of different custom types.

post
Insert CustomData

https://my.xena.biz/Api/Fiscal/{fiscalId}/Api/Fiscal/{fiscalId}/XenaCustomData/{xenaAppId}/{customType}
Inserts an instance of CustomData
Request
Response
Request
Path Parameters
xenaAppId
required
long
The app id
customType
required
string
The app-specific type
Response
200: OK
OK
Error
OK
{
"Success" = true,
"AssignedId" = "" // Guid
}
Error
{
"Success" = false,
"Errors" = ["Error1", "Error2"]
}

put
Update CustomData

https://my.xena.biz/Api/Fiscal/{fiscalId}/Api/Fiscal/{fiscalId}/XenaCustomData/{xenaAppId}/{customType}/{id}
Updates an instance of CustomData
Request
Response
Request
Path Parameters
xenaAppId
required
long
The app id
customType
required
string
The app-specific type
id
required
Guid
The instance id
Response
200: OK
OK
Error
OK
{
"Success" = true
}
Error
{
"Success" = false,
"Errors" = ["Error1", "Error2"]
}

get
Get CustomData

https://my.xena.biz/Api/Fiscal/{fiscalId}/Api/Fiscal/{fiscalId}/XenaCustomData/{xenaAppId}/{customType}/{id}
Gets a specific CustomData
Request
Response
Request
Path Parameters
xenaAppId
required
long
The app id
customType
required
string
The app-specific type
id
required
Guid
The instance id
Response
200: OK
OK
Error
OK
{ ...The app-specific json body here... }
Error
{
"Success" = false,
"Errors" = ["Error1", "Error2"]
}

get
List CustomData

https://my.xena.biz/Api/Fiscal/{fiscalId}/Api/Fiscal/{fiscalId}/XenaCustomData/{xenaAppId}/{customType}
Lists CustomDatas
Request
Response
Request
Path Parameters
xenaAppId
required
long
The app id
customType
required
string
The app-specific type
id
required
Guid
The instance id
Response
200: OK
OK
Error
OK
{
"Results" = [
{ ...The app-specific json body here... },
{ ...The app-specific json body here... }
],
"Any" = true|false
}
Error
{
"Success" = false,
"Errors" = ["Error1", "Error2"]
}