Frigg is a web service for updating TIX/EPCIS data based on a unique key uploaded as part of the event.


End-points: / (JSON), /auditlog (HTML or JSON, always JSON for errors)

Methods: GETPOST


/

The top level allows you to GET existing data, POST updates or DELETE an event entirely.

Valid methods

GET, POST, DELETE

GET

Get existing data for an event or specific extension on that event.

Parameters

Key

Value

Required

Default

Description

node

string of 16 digits

Yes


The 16 digit node id.

event_id

integer

Only without uuid / event_time


The event's database id.

event_time

timestamp

Only without event_id / uuid


Some kind of timestamp. For example:

2017-09-19T13:00:00

2017-09-19T13:00:00.123

2017-09-19T13:00:00.2Z

2017-09-19T15:00:00.0%b02:00

fieldname

string



The extension fieldname you want to get data for.

If this is not supplied info about the event itself is returned instead.

uuid

UUID string

Only without event_id / event_time


The UUID string identifying a single event.

If there are more or less than one match an error is returned.

uuid_field

string


uuid

The extension fieldname for the UUID string.

Example request

https://test.tracetracker.com/frigg/?node=0000000000000000&event_time=2017-09-19T13:00:00

Example response

Event

{
"action": 2,
"bizlocation": 272103069,
"bizstep": 272103018,
"disposition": 272103043,
"epcclass": null,
"epcisdocumentid": "32cf0cfc530e51650153c659d29413d641000026",
"epcsubgroup": "704738",
"eventtime": "2016-03-30 01:01:21",
"eventtimezoneoffset": 7200000,
"eventtype": 1,
"id": 272102338,
"knownextensions": 0,
"node": 108000019089001661,
"parentid": null,
"quantity": null,
"readpoint": 272103068,
"recordtime": "2016-03-30 09:08:08.722000",
"state": 2,
"transformationid": null,
"trd": null
}

Extension field

{
"datevalue": null,
"event": 272102338,
"fieldname": "weight",
"floatvalue": 280000,
"floatvalue2": null,
"id": 272102852,
"intvalue": 280000,
"node": 108000019089001661,
"open": false,
"ordinal": 0,
"prefix": 272103100,
"stringvalue": "280000",
"type": 2,
"unit": null
}



POST

Parameters

Key

Value

Required

Default

Description

node

string of 16 digits

Yes


The 16 digit node id.

event_id

integer

Only without uuid / event_time


The event's database id.

event_time

timestamp

Only without event_id / uuid


Some kind of timestamp. For example:

2017-09-19T13:00:00

2017-09-19T13:00:00.123

2017-09-19T13:00:00.2Z

2017-09-19T15:00:00.0%b02:00

old_epc

string



The current EPC value you want to change

new_epc

string



The new EPC value to set

fieldname

string



The extension fieldname you want to get data for.

If this is not supplied info about the event itself is returned instead.

fieldvalue

any



The value supplied will be tested for validity against the database schema and stored in the correct field.

E.g. timestamp (with or without timezone), float, integer, string.

add_missing

boolean


False

If True, add extension if it doesn't already exist. Extensions will not be added to an event without extensions.

uuid

UUID string

Only without event_id / event_time


The UUID string identifying a single event.

If there are more or less than one match an error is returned.

uuid_field

string


uuid

The extension fieldname for the UUID string.

Parameters fieldname/fieldvalue take presedence over old_epc/new_epc. If fieldname is specified, fieldvalue is required. Likewise, if old_epc or new_epc is specified the other is required.

Example request

curl -n -X POST https://test.tracetracker.com/frigg/?node=0000000000000000&uuid=****&fieldname=weight&fieldvalue=1400

Example response

{
"new_values": {
"datevalue": null,
"event": 82894068,
"fieldname": "alternateId",
"floatvalue": null,
"floatvalue2": null,
"id": 82894642,
"intvalue": null,
"node": 110000012390000111,
"open": false,
"ordinal": 0,
"prefix": 2357026,
"stringvalue": "2017-01-01T10:00:00",
"type": 2,
"unit": null
},
"old_values": {
"datevalue": null,
"event": 82894068,
"fieldname": "alternateId",
"floatvalue": null,
"floatvalue2": null,
"id": 82894642,
"intvalue": null,
"node": 110000012390000111,
"open": false,
"ordinal": 0,
"prefix": 2357026,
"stringvalue": "2017-01-01 10:00:00",
"type": 2,
"unit": null
},
"timestamp": "2017-09-18 13:24:31.515528+00:00",
"uuid": "c1a8b5bc-2a36-4d8e-a041-0bad3ba2b384"
}

The uuid in the response is not the uuid in the request but a new identifier logged in the auditlog together with the old and new values.

DELETE

This method requires the same parameters as the GET request.

A successful DELETE will remove the event in question from the TIX node it belongs to, hiding it in queries, but leaving it intact in the database.

/auditlog

This is an interface meant for human consumption and returns HTML. Except for when something goes wrong when it will return a more or less useful error message as JSON.

GET

Parameters

Key

Value

Required

Default

Description

node

string of 16 digits

Yes


The 16 digit node id.

Example request

https://test.tracetracker.com/frigg/auditlog?node=0000000000000000

Example response