Skip to content

API Query

damiancosmoschapman edited this page Feb 10, 2022 · 15 revisions

Home / API / Query

Create.

Creates a widget query for a specific user.

Authentication: Windows, Firebase

Privilege : Administrator , Moderator , Power User TODO Check

Method: PxStat.Subscription.Query_API.Create

Parameters:

Name Type Default Description
Uid String Firebase User UID*
AccessToken String Firebase access token*
TagName String Tag name for widget query
Matrix String Matrix name
Snippet Object Snippet object Note: Query field is the widget in Base64

*Parameter is not needed for Windows authentication

Example of Snippet object

{
   "Snippet":{
      "Type":"table",
      "Query":"eyIgYXV0b3VwZGF0ZSAiOnRydWUsIiBmbHVpZFRpbWUgIjpbMl0sIiBjb3B5cmlnaHQgIjp0cnVlLCIgdGl0bGUgIjp0cnVlLCIgbGluayAiOiIgaHR0cHM6IC8vZGV2LWRhdGEuY3NvLmllL3RhYmxlL0xSVzA3IiwicGl2b3QiOm51bGwsInJlbW92ZVJlZHVuZGFudENvbHVtbnMiOmZhbHNlLCJpbnRlcm5hdGlvbmFsaXNhdGlvbiI6eyJ1bml0IjoiVW5pdCIsInZhbHVlIjoiVmFsdWUifSwiZGVmYXVsdENvbnRlbnQiOiIuLiIsImRhdGEiOnsiYXBpIjp7InF1ZXJ5Ijp7InVybCI6Imh0dHBzOi8vZGV2LXdzLmNzby5pZS9wdWJsaWMvYXBpLmpzb25ycGMiLCJkYXRhIjp7Impzb25ycGMiOiIyLjAiLCJtZXRob2QiOiJQeFN0YXQuRGF0YS5DdWJlX0FQSS5SZWFkRGF0YXNldCIsInBhcmFtcyI6eyJjbGFzcyI6InF1ZXJ5IiwiaWQiOlsiVExJU1QoVzEpIiwiQzAyNjY1VjAzMjI1Il0sImRpbWVuc2lvbiI6eyJUTElTVChXMSkiOnsiY2F0ZWdvcnkiOnsiaW5kZXgiOlsiMjAyMVcxNSJdfX0sIkMwMjY2NVYwMzIyNSI6eyJjYXRlZ29yeSI6eyJpbmRleCI6WyItIl19fX0sImV4dGVuc2lvbiI6eyJwaXZvdCI6bnVsbCwiY29kZXMiOmZh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jb3JkcyBmb3VuZCIsInBhZ2luYXRlIjp7ImZpcnN0IjoiRmlyc3QiLCJsYXN0IjoiTGFzdCIsIm5leHQiOiJOZXh0IiwicHJldmlvdXMiOiJQcmV2aW91cyJ9LCJhcmlhIjp7InNvcnRBc2NlbmRpbmciOiI6IGFjdGl2YXRlIHRvIHNvcnQgY29sdW1uIGFzY2VuZGluZyIsInNvcnREZXNjZW5kaW5nIjoiOiBhY3RpdmF0ZSB0byBzb3J0IGNvbHVtbiBkZXNjZW5kaW5nIn19LCJzZWFyY2giOnsic2VhcmNoIjoiIn0sImRvbSI6IkJmbHRpcCIsInNjcm9sbFgiOmZhbHNlLCJyZXNwb25zaXZlIjp0cnVlLCJidXR0b25zIjpbeyJleHRlbmQiOiJjc3YiLCJ0ZXh0IjoiRG93bmxvYWQgQ1NWIiwiY2xhc3NOYW1lIjoiZXhwb3J0LWJ1dHRvbiIsInRpdGxlIjoiTFJXMDcuMjAyMjAxMDRUMTQwMTQ5In0seyJleHRlbmQiOiJwcmludCIsInRleHQiOiJQcmludCIsImNsYXNzTmFtZSI6ImV4cG9ydC1idXR0b24ifV0sIm9yZGVyIjpbWzAsImFzYyJdXSwib3B0aW9ucyI6e319fQ==",
      "Isogram":"https://dev-data.cso.ie/roched/4.0.0/widget/js/isogram.js",
      "FluidTime":false
   }
}

Return: Array [ Object ]

Name Type Description
MtrCode String Matrix Identifier
MtrTitle String Matrix Title
MtrNote String Matrix Note

ReadByProduct.

Returns a list of matrix codes and titles that are associated with the supplied product code.

Authentication: Windows

Privilege : Administrator , Moderator , Power User

Method: PxStat.Data.Matrix_API.ReadByProduct

Parameters:

Name Type Default Description
PrcCode String Product Code

Return: Array [ Object ]

Name Type Description
MtrCode String Matrix Identifier
MtrTitle String Matrix Name

ReadByCopyright.

Returns a list of matrix codes and titles that are associated with the supplied Copyright code.

Authentication: Windows

Privilege : Administrator , Moderator , Power User

Method: PxStat.Data.Matrix_API.ReadByCopyright

Parameters:

Name Type Default Description
CprCode String Copyright Code

Return: Array [ Object ]

Name Type Description
MtrCode String Matrix Identifier
MtrTitle String Matrix Description

ReadByLanguage.

Returns a list of matrix codes and titles that are associated with the supplied Language code.

Authentication: Windows

Privilege : Administrator , Moderator , Power User

Method: PxStat.Data.Matrix_API.ReadByLanguage

Parameters:

Name Type Default Description
LngIsoCode String Language Code

Return: Array [ Object ]

Name Type Description
MtrCode String Matrix Identifier
MtrTitle String Matrix Description

ReadCodeList.

Returns the list of matrices base on the user profile. If a version of the matrix exists in the LngIsoCode parameter, the matrix title will be returned in that language. Otherwise the default language version is returned.

Authentication: Windows

Privilege : Administrator , Moderator , Power User

Method: PxStat.Data.Matrix_API.ReadCodeList

Parameters:

Name Type Default Description
LngIsoCode String Default language Iso Language Code

Return: Array [ Object ]

Name Type Description
MtrCode String Matrix Code
MtrTitle String Matrix Title

ReadHistory.

Reads a release history of datasets. If a version of the matrix exists in the LngIsoCode parameter, the matrix title will be returned in that language. Otherwise the default language version is returned.

Authentication: Windows

Privilege : Administrator , Moderator , Power User

Method: PxStat.Data.Matrix_API.ReadHistory

Parameters:

Name Type Default Description
LngIsoCode Language IsoCode
DateFrom Date ('YYYY-MM-DD') Date From
DateTo Date ('YYYY-MM-DD') Date To

Return: Array [ Object ]

Name Type Description
RlsCode Int Release code
RlsLiveDatetimeFrom DateTime Start date and time of Release
RlsLiveDatetimeTo DateTime End date and time of Release
RlsVersion Int Release version
RlsRevision Int Release revision
GrpCode String Group code
GrpName String Group name
CcnUsername String Username
CreateDateTime DateTime Date and time of creation
MtrTitle String Matrix title*
RqsValue String Request Value
RqsCode String Request Code
RspValue String Response Value
RspCode String Response Code
SgnValue String Signoff Value
SgnCode String Signoff Code
*If a version of the matrix exists in the LngIsoCode parameter, the matrix title will be returned in that language. Otherwise the default language version is returned.

Validate.

Validates a .px file. If a validation error is identified then details are returned. The time dimension is obtained from the TIMEVAL key in px. If a TIMEVAL is not specified then the user must choose which dimension is to serve as a time dimension. Therefore when this situation is identified, a list of candidate dimensions is returned to the user in the FrqValue array.

Authentication: Windows

Privilege : Administrator , Moderator , Power User

Method: Method: PxStat.Data.Matrix_API.Validate

Parameters:

Name Type Default Description
MtrInput String The contents of the px file (Base64)
GrpCode String The Group code
FrqValue String The chosen dimension to serve as a time value
Overwrite Boolean false The Overwrite flag

Return: Object as below - Alternatively, an array of validation errors

Name Type Default Description
Signature String A validation token - returned if success
FrqValue String[] An array of candidate dimensions. Returned if valid but no time dimension identified

Create.

Creates a matrix from the contents of a .px file.

Authentication: Windows

Privilege : Administrator , Moderator , Power User

Method: Method: PxStat.Data.Matrix_API.Create

Parameters:

Name Type Default Description
MtrInput String The contents of the px file (Base64)
GrpCode String The Group code
FrqValue String The dimension value chosen as the time value where a TIMEVAL doesn't exist
Overwrite Boolean false The Overwrite flag

Return: String with value of success

Clone this wiki locally