Goldgate a.k.a. "Flex API" Client Development Documentation
2024.05.29.0
Introduction
Jonel Engineering's Goldgate application provides a RESTful-like API for transferring data between Jonel Engineering's Access Unlimited (AUJS) product and third-party applications. This document describes this interface so that developers may write software to utilize its services.
The Goldgate service provides data security by requiring that HTTPS be used for all transactions, and it also utilizes authentication schemes to control who is able to access/update system data. There are two different authentication modes supported by the Goldgate server:
General Information
Data transferred to/from Goldgate is in JSON format, which is easy for both humans and machines to read and generate. It is important that this data is correctly structured and parsed in order to successfully interact with the Goldgate service, and almost every programming language has packages/libraries to facilitate manipulation of JSON data.
Since all requests are simply HTTP methods, parameters supplied in URLs must be formatted using standard HTTP URL formatting and escaping. Typically, HTTP GET methods supply their parameters in the URL, whereas other methods (such as POST) supply parameters and data in the request body. AuthTokens can be supplied either in the URL or the request body, regardless of the HTTP method type.
Goldgate supports a mix of both types of clients ("Pre-Defined Clients" and "External Users"); Clients using the older "Pre-Defined Clients" mode can access the server alongside clients using the newer "External Users" mode. Developers creating new clients are encouraged to use the simpler "External Users" logon mode as the "Pre-Defined Clients" mode will deprecated in the future.
For time conversions, please use the following link https://www.datetimetoticks-converter.com/
Currently, Goldgate provides the following API endpoints for interacting with the AUJS system:
Endpoint | Description |
---|---|
nonce /logon | These endpoints provide the authentication "handshake" used to authenticate a client |
lookups | This endpoint returns several "Look Up" tables referenced by other endpoints. |
customers | Provides a list of current AUJS customer data |
products | Provides a list of concrete products as well as "other" products defined in AUJS |
rawmaterials | Gets the list of raw materials/ingredients referenced by concrete products |
salespeople | Gets the list of sales people currently defined in AUJS |
quotes | Gets list of active quotes for a specified customer |
quote | Retreive details of a single quote specified by its Quote ID |
addquote | Allows a client system to insert a quote record into AUJS's database |
appconfig | Allows a remote client application to retrieve the latest configuration settings |
trucks | Gets list of truck identfiers and descriptions for specified system type |
trucktickets | Gets list of active ticket identfiers and descriptions for specified truck identfier |
ticket | Gets ticket details for specified ticket identfier |
ticketimages (GET) | Gets ticket image attachments for specified ticket identfier |
ticketimages (POST) | Sends ticket image attachments for specified ticket identfier |
closeticket | Updates fields and marks as complete the ticket specified by the ticket identfier |
customertickets | Gets a filtered list of ticket summary records for a specified customer |
customerorders | Gets a filtered list of order summary records for a specified customer |
trucklocation | Updates the GPS coordinates of the specified truck |
exporttickets | Returns details of tickets over specified date range |
employeetimes | Returns details of time clock activities |
orderchanges | Returns changes to customer orders |
authorizations | Returns a token with the requested Permission Tag authorizations for the specified client |
Usage
Before any transaction, a client must first "Log On" to the service using either their ClientId and ClientKey ("Pre-Defined Clients" mode) or ClientId and AuthInfo ("External Users" mode) credentials. Goldgate will then issue the client an AuthToken that must be provided with each subsequent request in order to access the other endpoints. AuthTokens are tied to the ClientId and IP address, and by default expire after 5 minutes. The typical scenario for interacting with the Goldgate service is to authenticate/log-on before each transaction. Each time a client authenticates, the old AuthToken is disabled and a new one is created.
When a client application first starts up, it should attempt to log-on to acquire an AuthToken and then if required it should download the lookup data via the "lookup" endpoint. This allows the client application to verify that communications with the Goldgate service are operational, and provides the latest reference data used by some of the other endpoints of the service. A client may request the lookup data at other times if desired, such as after some interval or on demand of the client's user. Lookup data typically does not change very frequently and it should not be required to refresh it more than once after starting the client.
After downloading the lookup data, the client can then request updated records for other AUJS data, such as customers, products, raw materials, and sales people. Many of these endpoints also return a "timestamp" value that identifies the point in time the records represent. The client can return this timestamp value on the next endpoint request to only retrieve records that have been changed/added since the last request. By not providing a timestamp value (or using the value of zero) the client can retrieve all records of the desired type. The client can retrieve each endpoint independently if desired, or all within the same log-on transaction as desired. The client may invoke these endpoints at whatever frequency (hourly/daily/monthly) is deemed appropriate, or on demand by the user if desired. There is no requirement that these endpoints be invoked as a group, and each can be invoked at different intervals and separate transactions if desired.
Endpoints
nonce
This endpoint is used in "Pre-Defined Clients" mode to obtain a one-time random value that will be encrypted by the client using its ClientKey. This value is associated with the specified ClientId and cannot be used by any other client. The client hashes the nonce value (using SHA256 HMAC) with its ClientKey and returns that hash value using Base64 encoding to the logon endpoint.
Item | Value |
---|---|
Method | GET |
Example URL | https://server.com/goldgate/v1/nonce?ClientId=example-client-id |
Example Response | { |
logon
This endpoint is used to prove a client has the proper credentials to obtain an Authorization Token ("AuthToken") to be used with the other endpoints of this API. "Pre-Defined Clients" must first obtain a nonce from the nonce endpoint, then provide the "Response" parameter with the received nonce value hashed with the client's ClientKey which is then Base64 encoded, and supplied along with the matching "ClientId" parameter. "External User" logons will generate and supply the "AuthInfo" parameter as described above (instead of the "Response" parameter) along with the associated "ClientId". Upon providing valid parameters, this endpoint will return an authentication token that is used to access the rest of the API.
Item | Value |
---|---|
Method | POST |
Example URL | https://server.com/goldgate/v1/logon |
Example Request Data (Pre-Defined Client) | { |
Example Response | { |
Item | Value |
---|---|
Method | POST |
Example URL | https://server.com/goldgate/v1/logon |
Example Request Data (External User) | { |
Example Response | { |
lookups
This endpoint returns several small "lookup" tables that are referenced in the other endpoints. These lookup tables typically are loaded once during client startup and are used to lookup details about a record.
Item | Value |
---|---|
Method | GET |
Example URL | https://server.com/goldgate/v1/lookups?AuthToken=d03fe4c9-b13e-4b0d-b388-2346a2ab08b1 |
Example Response | { |
customers
Retrieves the selected customer detail records from AUJS. Each response to this endpoint supplies a "TimeStamp" value that can be passed into the next invocation of this endpoint to retrieve only records that have been changed or added since the last request. Supplying zero for the TimeStamp argument or omitting the TimeStamp parameter will return all records.
Item | Value |
---|---|
Method | GET |
Example URL | https://server.com/goldgate/v1/customers?AuthToken=d03fe4c9-b13e-4b0d-b388-2346a2ab08b1&TimeStamp=635859944000000000 |
Example Response | { |
products
Retrieves the selected concrete product and other product detail records from AUJS. Each response to this endpoint supplies a "TimeStamp" value that can be passed into the next invocation of this endpoint to retrieve only records that have been changed or added since the last request. Supplying zero for the TimeStamp argument or omitting the TimeStamp parameter will return all records.
Item | Value |
---|---|
Method | GET |
Example URL | https://server.com/goldgate/v1/products?AuthToken=d03fe4c9-b13e-4b0d-b388-2346a2ab08b1&TimeStamp=635877907760000000 |
Example Response | { |
rawmaterials
Retrieves the selected raw material detail records from AUJS. Each response to this endpoint supplies a "TimeStamp" value that can be passed into the next invocation of this endpoint to retrieve only records that have been changed or added since the last request. Supplying zero for the TimeStamp argument or omitting the TimeStamp parameter will return all records.
Item | Value |
---|---|
Method | GET |
Example URL | https://server.com/goldgate/v1/rawmaterials?AuthToken=d03fe4c9-b13e-4b0d-b388-2346a2ab08b1&TimeStamp=635877907760000000 |
Example Response | { |
salespeople
Retrieves the sales people detail records from AUJS. Each response to this endpoint supplies a "TimeStamp" value that can be passed into the next invocation of this endpoint to retrieve only records that have been changed or added since the last request. Supplying zero for the TimeStamp argument or omitting the TimeStamp parameter will return all records.
Item | Value |
---|---|
Method | GET |
Example URL | https://server.com/goldgate/v1/salespeople?AuthToken=d03fe4c9-b13e-4b0d-b388-2346a2ab08b1&TimeStamp=634818606340000000 |
Example Response | { |
quotes
This endpoint allows you to retrieve quotes for a specific customer. You can specify the system type (Aggregate, Block, or Concrete) and a Ship Date to select quotes that cover the specified date. Along with the required AuthToken
parameter this endpoint accepts the following parameters:
Parameter | Description |
---|---|
CustomerId | Required. An integer value that selects which customer's quotes should be searched |
SystemType | Optional. Must be one of the following string values: Aggregate , Block , or Concrete . If invalid or not specified, Concrete is assumed. |
ShipDate | Optional. A string in the form "YYYY-MM-DD" specifying a date to use for selecting quotes to return. Quotes with Start/Terminate dates containing this date will be returned. If this parameter is not specified or is invalid, today's date is assumed. |
Item | Value |
---|---|
Method | GET |
Example Request | https://server.com/goldgate/v1/quotes?AuthToken=A9CB4B2F-7512-415B-9B22-51178AADD15F&CustomerId=5&SystemType=Concrete&ShipDate=2024-05-15 |
Example Response | { |
quote
Retrieve details (including quoted products) of the specified quote. You can specify the system type (Aggregate, Block, or Concrete) to select products of the specified type. Along with the required AuthToken
parameter this endpoint accepts the following parameters:
Parameter | Description |
---|---|
QuoteId | Required. An integer value that selects which quote details should be returned |
SystemType | Optional. Must be one of the following string values: Aggregate , Block , or Concrete . If invalid or not specified, Concrete is assumed. |
Item | Value |
---|---|
Method | GET |
Example Request | https://server.com/goldgate/v1/quote?AuthToken=9E4C1950-71F4-4ED7-B0AB-DFCBC780EBBC&QuoteId=1&SystemType=Concrete |
Example Response | { |
addquote
This endpoint is used to add (import) a new quote into the AUJS system. The client system will build the quote data using the records obtained from this API and supply the following data in the body of the request.
Item | Value |
---|---|
Method | POST |
Example URL | https://server.com/goldgate/v1/addquote |
Example Request | { |
Example Response | { |
appconfig
Retrieves the latest configuration settings for the specified appId and version. "appid
" must be specified and is the assigned application identifier to retreive the configuration for. "ver
" is the version number of the configuration settings to be retreived. If "ver
" is missing or blank, then the first matching configuration for the specified version is returned. If ver
is specified but does not match any configured versions, then the returned Config
object is undefined. To protect the back-end from processing too many requests, this endpoint is rate-limited - making too many requests within a period of time will result in a 403-Forbidden response.
Item | Value |
---|---|
Method | GET |
Example URL | https://server.com/goldgate/v1/appconfig?AuthToken=d03fe4c9-b13e-4b0d-b388-2346a2ab08b1&appid=app.id&ver=1.0 |
Example Response | { |
trucks
Retrieves a list of trucks of the specified company type. "type
" can be one or more of "aggregate
", "concrete
" or "block
", separated by a hyphen (-
). If "type
" is not specified, then "concrete
" is assumed. The list of trucks does not change frequently, so it it sufficient to invoke this endpoint once at the start of a session. To protect the back-end from processing too many requests, this endpoint is rate-limited - making too many requests within a period of time will result in a 403-Forbidden response.
Item | Value |
---|---|
Method | GET |
Example URL | https://server.com/goldgate/v1/trucks?AuthToken=d03fe4c9-b13e-4b0d-b388-2346a2ab08b1&type=aggregate-concrete |
Example Response | { |
trucktickets
Retrieves a list of currently active tickets for the specified truckId. Note this is not the truck "Number", but the "Id" field as returned by the trucks
endpoint.
Item | Value |
---|---|
Method | GET |
Example URL | https://server.com/goldgate/v1/trucktickets?AuthToken=d03fe4c9-b13e-4b0d-b388-2346a2ab08b1&truckId=23 |
Example Response | { |
ticket
Retrieves the ticket details for the ticket specified using "TicketId
". Note this is not the same as "TicketNumber
". If the "Signature
" parameter is supplied and set to "true", the Base64 encoded image of the signature along with the "TermsAndConditions
" and "Waiver
" fields are included in the response if available. If the "ForcePricing
" parameter is supplied and set to "true", product pricing information will be returned regardless of the ticket's ChargeOrder status. To protect the back-end from processing too many requests, this endpoint is rate-limited - making too many requests within a period of time will result in a 403-Forbidden response.
Item | Value |
---|---|
Method | GET |
Parameters | AuthToken (string, required) - Authentication token provided by logon.TicketId (integer, required) - Id number of ticket to return (Not the same as the TicketNumber).Signature (bool, optional) - If true indicates that signature image data should be returned in addition to standard fields.ForcePricing (bool, optional) - If true indicates product pricing should be returned regardless of ticket's ChargeOrder status. |
Example URL | https://server.com/goldgate/v1/ticket?AuthToken=d03fe4c9-b13e-4b0d-b388-2346a2ab08b1&TicketId=14552&Signature=true&ForcePricing=false |
Example Response | { |
ticketimages
GET
Retrieves all ticket image attachments for the ticket specified using "TicketId
". Note this is not the same as "TicketNumber
". Image data is returned as an array of strings of base64 encoded images, one image per array element. If no images have been attached to the specified ticket or the specified TicketId
does not exist, an empty array is returned.
Item | Value |
---|---|
Method | GET |
Example URL | https://server.com/goldgate/v1/ticketimages?AuthToken=d03fe4c9-b13e-4b0d-b388-2346a2ab08b1&TicketId=14552 |
Example Response | { |
POST
This endpoint is used to add image attachments to the ticket specified by the supplied ticketId (not ticket number). Images are appended to the list of attached images for the specified ticket.
Item | Value |
---|---|
Method | POST |
Example URL | https://server.com/goldgate/v1/ticketimages |
Example Request | { |
Example Response | { |
closeticket
This endpoint is used to update the ticket specified by the supplied ticketId (not ticket number) with the supplied details and then mark the ticket as being completed. The AddedWaterPlant
and AddedWaterJob
fields are assumed to be zero if blank or missing. Signature
is ignored if blank or missing, but if a value is supplied it must be a valid Base64 encoding of an image file or the close request will be rejected. If a valid signature is supplied, the Terms
field must be supplied with the actual terms and conditions text displayed to the user when the signature was captured, or this endpoint will fail. The Waiver
and Notes
fields are optional, and if the CylinderTaken
field has no value or is not supplied will default to false
. The RejectLoad
if supplied and set to 'true' will cause the ticket to be marked as rejected by the customer when it is closed, otherwise the load will be treated normally.
Item | Value |
---|---|
Method | POST |
Example URL | https://server.com/goldgate/v1/closeticket |
Example Request | { |
Example Response | { |
customertickets
Retrieves a list of ticket summary fields for the specified customer, filtered by the supplied criteria parameters. The CustomerId
parameter is required, all others are optional. The optional filter criteria fields are:
- FromDate
- ThruDate
- TicketNum
- InvoiceNum
- OrderNum
- QuoteNum
- JobNum
- PONum
- TicketClosed
If a filter criteria field is blank or not supplied, then it will not be used to filter/restrict the returned records.
Item | Value |
---|---|
Method | GET |
Example URL | https://server.com/goldgate/v1/customertickets?AuthToken=d03fe4c9-b13e-4b0d-b388-2346a2ab08b1&CustomerId=45&FromDate="2017-07-12"&ThruDate="2017-07-12"&TicketNum=""&InvoiceNum="17-0991"&OrderNum="57"&QuoteNum=""&JobNum="4"&PONum="4"&TicketClosed=true |
Example Response | { |
customerorders
Retrieves a list of order summary fields for the specified customer, filtered by the supplied criteria parameters. The CustomerId
parameter is required, all others are optional. The optional filter criteria fields are:
- ShipDate
If a filter criteria field is blank or not supplied, then it will not be used to filter/restrict the returned records.
Item | Value |
---|---|
Method | GET |
Example URL | https://server.com/goldgate/v1/customerorders?AuthToken=d03fe4c9-b13e-4b0d-b388-2346a2ab08b1&CustomerId=45&ShipDate="2017-11-07" |
Example Response | { |
trucklocation
Sends the current GPS coordinates (in decimal format) for a specified truck to AUJS for status processing. You must supply a valid truckId
and valid decimal values for lat
, long
, speed
, and alt
are optional. If speed
is provided, it should be in "Meters per Second", and the option altitude value alt
should be supplied in "Meters".
Item | Value |
---|---|
Method | PUT |
Example URL | https://server.com/goldgate/v1/trucklocation?AuthToken=d03fe4c9-b13e-4b0d-b388-2346a2ab08b1&truckId=11&lat=33.493&long=-117.089&speed=85.1&alt=362.44 |
Example Response | { |
exporttickets
Retrieves a list of ticket detail records, filtered by the supplied date range and system type parameters.
Required Parameters:
- TicketFromDate - The date of the earliest ticket to retrieve in yyyy-mm-dd format
- TicketThruDate - The dat of the oldest ticket to retrieve in yyyy-mm-dd format
Optional parameters:
- SystemType - A list of one or more of the following system type specifiers, separated by hyphens (
-
). If this parameter is not specified or is empty,concrete
is assumed.concrete
aggregate
Item | Value |
---|---|
Method | GET |
Example URL | https://server.com/goldgate/v1/exporttickets?AuthToken=1a0b4100-bbf8-437e-ae42-e63464f1d08f&TicketFromDate="2018-10-10"&TicketThruDate="2018-10-11"&SystemType="concrete-aggregate" |
Example Response | "Payload": { |
employeetimes
Retrieves a list of employee time clock records, filtered by the supplied date range parameters, which are required. The required filter criteria fields are:
- WorkFromDate
- WorkThruDate
Item | Value |
---|---|
Method | GET |
Example URL | https://server.com/goldgate/v1/employeetimes?AuthToken=1a0b4100-bbf8-437e-ae42-e63464f1d08f&WorkFromDate="2018-10-10"&WorkThruDate="2018-10-11" |
Example Response | "Payload": { |
orderchanges
Retrieves a list of customer order change records, filtered by the supplied system type and date range parameters, which are required. The required filter criteria fields are:
- SystemTypeId
- ChangeFromDate
- ChangeThruDate
Item | Value |
---|---|
Method | GET |
Example URL | https://server.com/goldgate/v1/orderchanges?AuthToken=1a0b4100-bbf8-437e-ae42-e63464f1d08f&SystemTypeId=1&ChangeFromDate="2018-07-01"&ChangeThruDate="2018-09-01" |
Example Response | "Payload": { |
authorizations
Retrieves a JSON Web Token (JWT) containing the permission status of the supplied Permission Tags for the specified user. Note you must provide the same credential details (ClientID and AuthInfo) for the specified user as you would supply to the logon
endpoint. Only "External Users" credentials mode is supported by the authorizations
endpoint, "Pre-Defined Users" mode is not supported. The following parameters are required:
- ClientId
- AuthInfo
- PermissionTags
If the specified ClientId doesn't exist or the AuthInfo isn't valid for the specified ClientId and Server, a standard error response payload is returned.
A successfull request will return a JWT with a JSON payload similar to the following:
{ "authzs": { "Goldgate": true, "LoadTrack": true }, "client": { "custid": 5, "chgpwd": true }, "iss": "server.com", "sub": "rick.sanchez@jonel.com", "exp": 1678458432
}
where the authzs
object contains the boolean authorization status for one or more specified PermissionTags
, separated by tilde (~
) characters. Note that the client MUST validate the signature on the JWT before processing any data in the payload, and must also honor the exp
expiration field (Unix Timestamp). Clients should also verify that the iss
(Issuer) and sub
(Subject) fields match the values expected.
Item | Value |
---|---|
Method | GET |
Example URL | https://server.com/goldgate/v1/authorizations?AuthToken=1A0B4100-BBF8-437E-AE42-E63464F1D08F&ClientId="Rick.Sanchez@jonel.com"&AuthInfo="Sm9uZWwgRW5naW5lZXJpbmcsIEluYy4*1678457505"&PermissionTags="Goldgate~LoadTrack" |
Example Response | "Payload": { |
History
- 2019-05-28 (V1.12.1.0): Added ShortLoadTypes to
lookups
endpoint response andShortLoadTypeId
tocustomers
endpoint response. - 2019-06-17 (V1.12.1.0): Added missing
ShortLoadTypeId
tocustomers
endpoint response. - 2019-09-16 (V1.12.5.0): Added
Strength
andAggregateSize
fields toticket
endpoint response. - 2020-02-24 (V1.12.7.0): On
closeticket
endpoint, changedAddedWater
toAddedWaterJob
, addedAddedWaterPlant
,MeasuredSlump
, &ReturnedConcrete
fields to incoming data. AddedToJobDatetime
&FormulaSlump
fields toticket
endpoint response. - 2020-02-28 (V1.12.7.0): Added
WaterAddedJob
&WaterAddedPlant
fields toticket
endpoint response (originalWaterAdded
field now returns sum of new fields) - 2020-05-28 (V1.13.2.0): Added
EmailRecipients
fields toticket
endpoint response and tocloseticket
endpoint request. - 2020-08-24 (V1.14.2.0): Added
UOM_Id
field to Ticket.Products inticket
endpoint response. - 2020-09-02 (V1.14.2.0): Added
PlantId
field to Ticket.Plant inticket
endpoint response. - 2020-09-16 (V1.15.0.0): Added
LeaveJobDatetime
&ArrivePlantDatetime
toticket
endpoint response. - 2020-12-04 (V1.15.1.0): Added PerHundredWeight field to Concrete.Plants.Materials in
products
endpoint response. - 2021-06-03 (V1.15.3.0): Add OrderStatus and JobAddress to
customerorders
endpoint response. - 2021-09-16 (V1.15.5.0): Add
StatusId
andIsInactive
toticket
endpoint response - 2021-10-28 (V1.15.6.0): Add
SlumpOrdered
toticket
endpoint response - 2023-03-20 (V1.17.0.0): Add "External Users" mode to
logon
endpoint, Addauthorizations
endpoint - 2023-09-15 (V1.17.0.0): Add support for aggregate tickets on
exporttickets
endpoint - 2023-09-15 (V1.17.0.0): Add
TruckType
andSystemType
result fields totrucks
endpoint - 2023-09-15 (V1.17.0.0): Add 'TruckTypes' to 'lookups' endpoint result sets
- 2023-10-04 (V1.17.1.0): Add QuoteId to
addquote
response - 2024-05-07 (V1.17.7.0): Add
ProductId
andNumber
fields toProducts
andIngredients
objects in theticket
endpoint result. - 2024-05-07 (V1.17.7.0): Add several new fields to
customers
endpoint result. - 2024-05-15 (V1.18.0.0): Add
quotes
andquote
endpoints - 2024-05-29 (V1.18.0.0): Add
FormulaSlump
field toquote
endpoint result.
Was this article helpful?
That’s Great!
Thank you for your feedback
Sorry! We couldn't be helpful
Thank you for your feedback
Feedback sent
We appreciate your effort and will try to fix the article