BI20001: API Insert And Delete

 

OVERVIEW

A process token with a procID value of 21 has to be requested and acquired before this process executes. It can only be used once and expires after an hour (60 minutes).

The user or the 3rd party app must have the following already setup:

  • B.I. Storage Uploader record
  • Allowed data storage id’s
  • Check the “Allow API To Upload Directly To The Data Storage And Bypass the “Queue And Process” operation.

Note: The request must match the count and id’s of the “Storage ID’s” from the Allowed Data Storage.

PROPERTIES

  • REQUEST:
    • prgInf – program to request
      • pMODL – program group
      • pPRGM – program code
      • pPRGDSC – program description
    • saveData
      • datStrList – array of data storage id’s with the data to insert or delete
        • datStrID  – the data storage id to insert to or delete from
          • rows – the array of data rows to insert or delete
            • operation – the INSERT or DELETE operation
            • hdrID – the INSERT header sequence (set to zero when not in a DELETE operation)
            • detID – the INSERT detail sequence (set to zero when not in a DELETE operation)
            • fields – array of data in the same order of the fields listed in the data storage ids’ profile
    • portalID – program group
    • portID – the portal type
    • subsID – subscribers’ database id
    • intGID – ikonomikal id
    • userID – registered email address
    • sessID – session id
    • timeOffSet – adjustment to the browsers’ date and time
  • RESPONSE:
    • insHdrID – the INSERT sequence (value is >zero(0) when there’s an insert operation)
    • delHdrID – the DELETE sequence (value is >zero(0) when there’s a delete operation)
    • modInf
      • mUser – system user that made the upload
      • mGroup – system group that made the upload
      • mDate – upload date
      • mTime – upload time
    • rspChr
      • rspID – response id (a zero(0) response is a successful response)
      • rspMsg – error message
      • rspChr – error message parameters

ENDPOINT

https://bi-api.ikonomikal.com/bcss_wbcl_wa_bi/api/O1_setBIDatStrDatUpl

HTTP VERB

POST

HEADERS

Content-Type: application/json

REQUEST

{"prgInf":{"pMODL":"","pPRGM":"","pPRGDSC":""},"saveData":{"datStrList":[{"datStrID":"","rows":[{"operation":"","hdrID":0,"detID":0,"fields":[]}]}]},"cmdStat":0,"portalID":"","portID":0,"subsID":"","intGID":"","userID":"","sessID":"","timeOffSet":0}

RESPONSE

{"insHdrID":0,"delHdrID":0,"modInf":{"mUser":"","mGroup":"","mDate":0,"mTime":0},"rspPrc":{"rspID":0,"rspMsg":"","rspChr":[]}}


EXAMPLE

REQUEST:

{"prgInf":{"pMODL":"BI","pPRGM":"BI20001","pPRGDSC":""},"saveData":{"datStrList":[{"datStrID":"PRODUCT_ORDERS","rows":[{"operation":"INSERT","hdrID":0,"detID":0,"fields":["SO00001","ABC Company",0]},{"operation":"INSERT","hdrID":0,"detID":0,"fields":["SO00002","DEF Company",0]}]},{"datStrID":"ORDER_ITEMS","rows":[{"operation":"INSERT","hdrID":0,"detID":0,"fields":["SO00001",1,"Item Product 1",1.5,3.5,5.25,0]},{"operation":"INSERT","hdrID":0,"detID":0,"fields":["SO00001",2,"Item Product 2",2.5,4.5,11.25,0]},{"operation":"INSERT","hdrID":0,"detID":0,"fields":["SO00002",1,"Item Product 1",5.5,7.5,41.25,0]},{"operation":"INSERT","hdrID":0,"detID":0,"fields":["SO00002",2,"Item Product 2",6.5,8.5,88.25,0]}]}]},"cmdStat":0,"portalID":"","portID":0,"subsID":"00001","intGID":"4350AABE-9008-4E5F-9121-8471DD6868C6","userID":"ikotestmail@yahoo.com","sessID":"8498DE85-611C-4A00-AD71-9FB36C69805B","timeOffSet":-180}

RESPONSE:

{"insHdrID":0,"delHdrID":0,"modInf":{"mUser":"API01","mGroup":"FORAPIACCESS01","mDate":20171214,"mTime":170134},"rspPrc":{"rspID":0,"rspMsg":"","rspChr":[]}}