"

Secured API Overview

These APIs handle sensitive processes or write to the GramChain requiring additional security and separation from public APIs.

Note that there are separate writing APIs for scanner (for vault personnel) and for Web Interfaces (Admin, locks)

The GramChain API requires the following default parameters:
  1. LanguageID = this field is a two character support for simple multi-language. Default value is 'en' for English, 'cn' for Chinese.
  2. EntityID = a field which allows for different results to be returned based on caller entity, (e.g. Cache, P2P, scanner) for scanner entries use empty string '' as default
  3. CallerID = the userID calling this API (if known). This allows for traceability of data access (required for scanner) but is not a required for public calls and can be left black.

Last 10 logged Errors:

ErrorLogIDErrorProcedureErrorDescriptionLogTime
253365SpotInsertMsg: Violation of PRIMARY KEY constraint 'PK_Spot'. Cannot insert duplicate key in object 'dbo.Spot'. The duplicate key value is (Apr 23 2024 4:55PM, pt).\r\nThe statement has been terminated. Source: .Net SqlClient Data Provider4/23/2024 4:55:58 PM
253364SpotInsertMsg: Violation of PRIMARY KEY constraint 'PK_Spot'. Cannot insert duplicate key in object 'dbo.Spot'. The duplicate key value is (Apr 9 2024 4:55AM, pt).\r\nThe statement has been terminated. Source: .Net SqlClient Data Provider4/9/2024 4:55:35 AM
253363ShippingRouteInsertMsg: The INSERT statement conflicted with the FOREIGN KEY constraint \"FK_ShippingRoutes_CountryCode\". The conflict occurred in database \"GramChain-API-Test\", table \"dbo.CountryCode\", column 'CountryCode'.\r\nThe statement has been terminated. Source: .Net SqlClient Data Provider4/5/2024 11:17:02 PM
253362SpotInsertMsg: Violation of PRIMARY KEY constraint 'PK_Spot'. Cannot insert duplicate key in object 'dbo.Spot'. The duplicate key value is (Apr 4 2024 8:55AM, ag).\r\nThe statement has been terminated. Source: .Net SqlClient Data Provider4/4/2024 8:55:36 AM
252364DomainExplorerSettingsSelectMsg: Failed to convert parameter value from a String to a DateTime. Source: System.Data4/2/2024 7:47:53 AM
252363BidOverSpotsInsertMsg: Cannot insert duplicate key row in object 'dbo.BidsOverSpot' with unique index 'IX_UniqueVaultCompany'. The duplicate key value is (, ).\r\nThe statement has been terminated. Source: .Net SqlClient Data Provider4/2/2024 6:43:12 AM
252362ShippingRouteInsertMsg: The INSERT statement conflicted with the FOREIGN KEY constraint \"FK_ShippingRoutes_CountryCode\". The conflict occurred in database \"GramChain-API-Test\", table \"dbo.CountryCode\", column 'CountryCode'.\r\nThe statement has been terminated. Source: .Net SqlClient Data Provider4/2/2024 3:04:43 AM
252361BidOverSpotsInsertMsg: Cannot insert duplicate key row in object 'dbo.BidsOverSpot' with unique index 'IX_UniqueVaultCompany'. The duplicate key value is (, ).\r\nThe statement has been terminated. Source: .Net SqlClient Data Provider3/30/2024 2:52:34 AM
252360DomainExplorerSettingsSelectMsg: Failed to convert parameter value from a String to a DateTime. Source: System.Data3/30/2024 12:32:06 AM
252359DomainExplorerSettingsSelectMsg: Failed to convert parameter value from a String to a DateTime. Source: System.Data3/26/2024 6:09:42 AM

API Interfaces

GetSpotPrices (Link: GetSpotPrices?CallerID=adhoc&LanguageID=&EntityID=&AsOfDAte=&MetalCode=&ByGram=True )
Retrieve the spot prices as of a provided date
Calling Parameters:

GetUserEditLog (Link: GetUserEditLog?CallerID=adhoc&LanguageID=&EntityID=&CompanyID=&TableName=&EditID=&AddedBy=&LogNoteSearch=&UpToDate=&TopXRows=50 )
Retrieve the spot prices as of a provided date
Calling Parameters:

UpdateMetalPrice (Link: UpdateMetalPrice?CallerID=adhoc&LanguageID=&EntityID=&AsOfDAte=&MetalCode=&ByGram=True )
USED TO UPDATE spot PRICES into gramchain called at regular intervals
Calling Parameters:

GlobalSettings (Link: GlobalSettings?EntityID=&CallerID=Adhoc&LanguageID=en&AsOfDate=&SettingName=&Category= )
GlobalSettings can store any global variable in a time consistent manner (e.g. you can query using an 'asofdate') and is cached for fast retrieval.
Calling Parameters:

ErrorLog (Link: ErrorLog?EntityID=&CallerID=tester&LanguageID=&TopRrowsFilter=1000&FromDate=&ToDate=&CallerIDfilter=&ErrorContextidFilter=&ErrorProcedureFilter=&ErrorCategoryFilter=&ErrorDescriptionSearch= )
Returns the latest recorded errors.
Calling Parameters:

ProviderByScannerID (Link: ProviderByScannerID?LanguageID=en&EntityID=&CallerID=UserID&ScannerID= )
The various vaults. For scanners use the ScannerID to retrieve the vault the scanner is assigned to.
Calling Parameters:

RFIDBySerialNr (Link: RFIDBySerialNr?LanguageID=en&EntityID=&CallerID=UserID&SerialNr=&VaultID= )
API/Secured/RFIDBySerialNr: Returns the RFIDs or multiple RFIDS (in case multiple parcels have the same serials) for a given SerialNr in a given VaultID. Can be used to physically find a parcel using the scanner if the serial is known.
Calling Parameters:

VaultLocationsByVaultID (Link: VaultLocationsByVaultID?LanguageID=en&EntityID=&CallerID=UserID&VaultID= )
Returns the VaultLocations for a given vault. Can be used for inventory scanning of a vault area using the scanner
Calling Parameters:

EventTypesByProvider (Link: EventTypesByProvider?EntityID=&LanguageID=en&CallerID=&ProviderID=&Application= )
Provides Events and Filters that can be performed depending on ProviderID. Used by WebUI.
Calling Parameters:

ParcelsByVaultLocation (Link: ParcelsByVaultLocation?LanguageID=en&EntityID=&CallerID=UserID&VaultID=&VaultLocation= )
Returns the Parcels for a given VaultLocation. Can be used by scanner for inventory check purposes. Only usable if a VaultLocation is specified
Calling Parameters:

Hash_UnsentBroadcastHashes_Check (Link: Hash_UnsentBroadcastHashes_Check?LanguageID=en&EntityID=&CallerID=UserID )
Broadcasts any pending GramChain event(s) to the ethereum blockchain.
Calling Parameters:

Hash_UnconfirmedTxIDs_Check (Link: Hash_UnconfirmedTxIDs_Check?LanguageID=en&EntityID=&CallerID=UserID )
Updates any blockchain transaction that is unconfirmed, with a new transaction ID and number of confirmations
Calling Parameters:

LoginListByScannerID (Link: LoginListByScannerID?LanguageID=en&EntityID=&CallerID=UserID&ScannerID= )
Logins of Vault Staff, given a certain ScannerID (used by scanners which retrieve VaultID automatically) or VaultID (used for non scanners applications). Note that CallerID parameter is not available for scanners at this point, just leave blank.
Calling Parameters:

GramChainRepackageParcel (Link: GramChainRepackageParcel?SerializedImage=&OldRFID=1234567890&oldserial=123456789&newRFID=123321&newserial=123456789&ScannerID=987654321&MacAddress=00 - 14 - 22 - 01 - 23 - 45&IPAddress=234-234-232-123&CallerID=TSHDude&LanguageID=en&RepackReasonCode= )
Repackage a Parcel. The OldRFID and CompositeSerial is needed to identify the old Parcel. Then the new RFID code and optionally a new Serial can be inserted. The new serial is needed in cases where a tamper evident bag with ID, instead of a bar serial number, was used to identify the item and the bag tore.
Calling Parameters:

DocumentWebUIUpload (Link: DocumentWebUIUpload?SerializedBase64Doc=&DocumentExtension=pdf&LanguageID=en&EntityID=&CallerID= )
Insert a document
Calling Parameters:

GramChainInsertViaScannerWithURL (Link: GramChainInsertViaScannerWithURL?ImageURL=https%3A%2F%2Fwww.silverbullion.com.sg%2FUploads%2Fkimsabularse%2FNadir_Silver_15_kg.jpg&RFID=123&EventTypeCode=Scan&ScannerID=987654321&ItemQuantity=1&BrandCode=RCM&ItemTypeCode=Bar&SerialNR=123456789&MetalCode=AU&MeasurementCode=g&MeasurementWeight=1&Purity=0.999&MacAddress=00 - 14 - 22 - 01 - 23 - 45&IPAddress=234-234-232-123&CallerID=TSHDude&LanguageID=en&VaultLocation=&EventGrouping=&ParcelName=&ItemCategoryCode=&FixedValuation=0&ValuationCurrency=&ValuationNote=&MinBroadcastBatch=1 )
Insert Event for Scanner, using an image URL rather than Base 64 source
Calling Parameters:

GramChainBulkInsert (Link: GramChainBulkInsert?eventsToInsert=&LanguageID=&EntityID=&CallerID= )
Insert Event for Scanner
Calling Parameters:

GramChainInsertViaScanner (Link: GramChainInsertViaScanner?SerializedImage=&RFID=123&EventTypeCode=Scan&ScannerID=987654321&ItemQuantity=1&BrandCode=RCM&ItemTypeCode=Bar&SerialNR=123456789&MetalCode=AU&MeasurementCode=g&MeasurementWeight=1&Purity=0.999&MacAddress=00 - 14 - 22 - 01 - 23 - 45&IPAddress=234-234-232-123&CallerID=TSHDude&LanguageID=en&VaultLocation=&EventGrouping=&ParcelName=&ItemCategoryCode=&FixedValuation=0&ValuationCurrency=&ValuationNote=&MinBroadcastBatch=1 )
Insert Event for Scanner
Calling Parameters:

GramChainInsertViaWeb (Link: GramChainInsertViaWeb?EntityID=&RFID=&EventTypeCode=&EventTypeSubCode=&UtilizationLockGroup=&CustodianID=&EventNote=&DocumentHash=&DocumentLink=&EventGrouping=&InternalComments=&CallerID=&LanguageID=en&MinBroadcastBatch=1 )
Insert a Bar List Log entry from a Web Interface
Calling Parameters:

StorageLogSelectBySerial (Link: StorageLogSelectBySerial?LanguageID=en&EntityID=&CallerID=UserID&AsOfDate=&SerialNR=&CompositeSerial_like=&VaultID= )
Retrieves a Single LogRecord on or prior the specified AsOfDate (UTC time) with data relevant for scanner. if no AsOfDate is specified the current UTC time is used, which returns the latest record
Calling Parameters:

GramChainSelectViaScanner (Link: GramChainSelectViaScanner?LanguageID=en&EntityID=&CallerID=UserID&AsOfDate=&RFID= )
Retrieves a Single LogRecord on or prior the specified AsOfDate (UTC time) with data relevant for scanner. if no AsOfDate is specified the current UTC time is used, which returns the latest record
Calling Parameters:

BulkWebEventInsert (Link: BulkWebEventInsert?eventsToInsert=&LanguageID=en&EntityID=&CallerID=&DocumentHash=&DocumentExtension=&internalComments=&UtilizationLockGroup= )
Inserts Web Bulk Insert, these are normally called for assignements or other operations requiring multiple events
Calling Parameters:

BulkScanInsert (Link: BulkScanInsert?JsonObject=&VaultLocation=&MacAddress=&IPAddress=&CallerID=&LanguageID= )
Inserts BulkScan events, these are normally called when an inventory or audit is conducted
Calling Parameters:

LabelBulkInsert (Link: LabelBulkInsert?JsonObject=&LanguageID=&CallerID= )
Insert a Label, these are used for UI interfaces to support multiple languages
Calling Parameters:

BrandCodeInsert (Link: BrandCodeInsert?BrandCode=&LanguageID=en&ItemCategoryCode=&BrandName=&BrandDescription=&URL=&AddedBy= )
Insert a BrandCode. These are the approved Refiners and Mints that can be added into the barlist
Calling Parameters:

ItemTypeInsert (Link: ItemTypeInsert?ItemTypeCode=&LanguageID=en&ItemCategoryCode=&TypeName=&TypeDescription=&URL=&AddedBy= )
Insert a ItemType, These are a Grouping to describe the item
Calling Parameters:

LabelInsert (Link: LabelInsert?EntityID=&LanguageID=en&LabelGroup=&Label=&Value=&Remark=&Device=w&AddedBy= )
Insert a Label, these are used for UI interfaces to support multiple languages
Calling Parameters:

MetalCodeInsert (Link: MetalCodeInsert?MetalCode=&LanguageID=en&ItemCategoryCode=&MetalName=&MetalDescription=&URL=&AddedBy= )
Insert a Metal, this is a Grouping describing the item
Calling Parameters:

ScannerAtLocationInsert (Link: ScannerAtLocationInsert?LanguageID=&ScannerID=&ProviderID=&FromDate=&Comment=&AddedBy= )
Insert a ScannerAtLocation, This links a scanner to a given storageprovider.
Calling Parameters:

LoginInsert (Link: LoginInsert?LanguageID=&OperatorLoginID=&ProviderID=&FromDate=&Password=&AddedBy= )
Insert a Scanner Login, This is specific to a storageprovider and used to log into the scanners.
Calling Parameters:

GlobalSettings_SystemInsert (Link: GlobalSettings_SystemInsert?EntityID=&LanguageID=&Name=&TextValue=&DataType=&Category=&EffectiveDate=&SettingDescc=&AddedBy= )
Insert a GlobalSetting_System. These are settings that are protected from being read by the public.
Calling Parameters:

GlobalSettingsInsert (Link: GlobalSettingsInsert?EntityID=&LanguageID=&Name=&TextValue=&DataType=&Category=&EffectiveDate=&SettingDescc=&AddedBy= )
Insert a GlobalSetting.
Calling Parameters:

ScannerInsert (Link: ScannerInsert?ScannerID=&LanguageID=en&ScannerDescription=&ScannerType=&ScannerSerial=&FromDate=&AddedBy= )
Insert a Scanner, This must then be assigned to a storageprovider using a ScannerAtLocation insert.
Calling Parameters:

ProviderEnableServices (Link: ProviderEnableServices?LanguageID=en&EntityID=&CallerID=&ProviderID=&EnableShipping=False&EnableSellBack=False&EnableListing=False )
Enables or disables Provider/company services such as shipping and sellback. Ensure to pass EnableShipping,EnableSellBack and EnableListing even if only 1 is changed
Calling Parameters:

ProviderInsert (Link: ProviderInsert?LanguageID=en&EntityID=&CallerID=&ProviderID=&ProviderType=Storage&Name=&Zip=&CountryCode=&Email=&Phone=&URL=&InternalSupportPhone=&InternalSupportEmail=&InternalNotes=&CompanyID=&ProviderMeasurementCode=&ProviderTimeZone=&ProviderCurrencyCode=&ProviderLanguageID= )
Insert, update or delete a Storage Provider
Calling Parameters:

ShippingRouteInsert (Link: ShippingRouteInsert?LanguageID=en&EntityID=&CallerID=UserOne&CompanyID=&ProviderID=&ToCountryCode=&ZipFrom=0&ZipTo=0&PostalCodeStart=&ShippingRateID=0&ShippingRouteID=0 )
Inserts, Updates or Deletes a Row. If no ShippingRouteID is provided or the ShippingRouteID does not exist a new row is created, else the ShippingRouteID row is updated. To delete an existing row provide the ShippingRouteID and leave the CompanyID parameter blank (\"\")
Calling Parameters:

ShippingRateInsert (Link: ShippingRateInsert?LanguageID=en&EntityID=&CallerID=UserOne&CompanyID=&RateName=&MinShipmentKG=0&ByWeightFee=0&ByValueFeePer=0&FixedFee=0&ShippingRateID=0 )
Inserts, Updates or Deletes a Row. If no ShippingRouteID is provided or the ShippingRouteID does not exist a new row is created, else the ShippingRouteID row is updated. To delete an existing row provide the ShippingRouteID and leave the CompanyID parameter blank (\"\")
Calling Parameters:

BidOverSpotInsert (Link: BidOverSpotInsert?LanguageID=en&EntityID=&CallerID=UserID&CompanyID=&ProviderID=&BidOverSpotUSD=0&BidKGMinimum=0&BidOverSpotID=0 )
Inserts, Updates or Deletes a Row. If no BidOverSpotID is provided or the BidOverSpotID does not exist a new row is created, else the BidOverSpotID row is updated. To delete an existing row provide the BidOverSpotID and leave the CompanyID parameter blank (\"\")
Calling Parameters:

EventsFiltered (Link: EventsFiltered?EntityIDfilter=&CallerID=adhoc&LanguageID=&FromDate=&ToDate=&EventTypeCodefilter=&UtilizationLockCodefilter=&VaultIDfilter=&CustodianIDfilter=&ScannerIDfilter=&OperatorLoginIDfilter= )
Historical Events Filtered by various parameters (this procedure can return many events per RFID, do not use as inventory tool)
Calling Parameters:

"