"

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
254510DomainExplorerSettingsSelectMsg: Failed to convert parameter value from a String to a DateTime. Source: System.Data2/4/2025 11:18:29 AM
254509ShippingRouteInsertMsg: 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 Provider2/1/2025 10:18:09 AM
254508BidOverSpotsInsertMsg: 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 Provider2/1/2025 10:16:54 AM
254507DomainExplorerSettingsSelectMsg: Failed to convert parameter value from a String to a DateTime. Source: System.Data2/1/2025 10:13:46 AM
254506SpotInsertMsg: Login failed for user 'gramchain'. Reason: The password of the account has expired. Source: .Net SqlClient Data Provider1/17/2025 8:54:55 AM
254505SpotInsertMsg: Login failed for user 'gramchain'. Reason: The password of the account has expired. Source: .Net SqlClient Data Provider1/17/2025 7:03:51 AM
254504SpotInsertMsg: Login failed for user 'gramchain'. Reason: The password of the account has expired. Source: .Net SqlClient Data Provider1/17/2025 6:58:44 AM
254503SpotInsertMsg: Login failed for user 'gramchain'. Reason: The password of the account has expired. Source: .Net SqlClient Data Provider1/17/2025 6:51:45 AM
254502SpotInsertMsg: Login failed for user 'gramchain'. Reason: The password of the account has expired. Source: .Net SqlClient Data Provider1/17/2025 6:46:44 AM
254501SpotInsertMsg: Login failed for user 'gramchain'. Reason: The password of the account has expired. Source: .Net SqlClient Data Provider1/17/2025 6:41:44 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:

"