Contact Tracing Log and Summary APIs
Knowledge Base > Products > Software > Loop Cloud > Contact Tracing Log and Summary APIs
Authentication and Access Tokens
Overview
Currently, all API Requests require the usage of a token to provide access to Loop Cloud v2’s API Endpoints. Each generated token will only provide access for up to 1 hour and will only provide access to the organization data associated with that specific user. Below is an overview of the token generation and method of how to use this token.
Token Generation
API Request Overview
Endpoint |
|
Method |
POST |
Content-type |
application/x-www-form-urlencoded |
Body |
|
Example Response Body
{ “access_token”: “abc123”, “token_type”: “Bearer”, “expires_in”: 3600 } |
Key |
Format |
Usage |
---|---|---|
access_token |
string |
Temporary Access Token which can be used in Loop Cloud API Requests |
token_type |
string |
Information of token type, i.e. Bearer |
expires_in |
int (seconds) |
Number of seconds remaining until token expires |
Token Usage
Below is an example of a user with access to a sample BlueCats organization requesting logs using a valid temporary token for a target date range.
Endpoint | https://api.us.loop.bluecats.com/reports/logs/tagcontacts |
Method |
GET |
Headers |
|
Parameters |
|
Contact Tracing Logs API
Overview
Tag Contacts are generated when two tags enter within one of two ranges In Contact
or Nearby
. A Tag Contact log is a record summarising the time the tags spent in range of each other. To query the data, the user requires an active Bearer Token
, organization id
and group id
, which can be obtained by the methods presented in the Token Generation API
section above.
Tag Contact Log – By Organization/Group
API Request Overview
Endpoint | https://api.us.loop.bluecats.com/reports/logs/tagcontacts |
Method |
GET |
Pagination Type |
Next token |
Description |
Iterate through available logs by ordered by date (either log event timestamp – timestamp or log create/processed timestamp – createdAt |
Headers |
|
Example Query |
|
Request Parameters
Key |
Attributes |
Description |
groupId |
Required |
Filter by Organization Group |
from |
Optional |
Starting timestamp to return events from |
to |
Optional |
when ‘to’ is specified then the results will be ascending, otherwise they will be descending. |
limit |
Optional |
Maximum number of results to return |
next |
Optional |
Continuation token to paginate through results. When this value is populated in the response, it can be passed to subsequent requests to retrieve additional events. |
proximity |
Optional |
Nearby|Contact |
duplicates |
Optional |
When |
invalidEvents |
Optional |
When |
sortByTimestampAscending |
Optional |
|
timestampField |
Optional |
Log event timestamp – |
minimumDurationSeconds |
Optional |
Minimum contact duration to include for individual logs |
objectStereotype |
Required when timestampField=’timestamp’. Not applicable when timestampField=’createdAt’ |
Filter results by the target object’s stereotype. Valid values are |
contactStereotype |
Required when timestampField=’timestamp’. Not applicable when timestampField=’createdAt’ |
Filter results by the target contact object’s stereotype. Valid values are |
Example Response Body
{"next": "2020-01-01T09:00:00Z_bc000000-0000-0000-0000-000000000000_bc000000-0000-0000-0000-000000000001","limit": 1,"items": [{"id": "bc000000-0000-0000-0000-000000000000","orgId": "bc000000-0000-0000-0000-000000000001","groupId": "bc000000-0000-0000-0000-000000000002","offloadDeviceId": "bc000000-0000-0000-0000-000000000003","offloadDeviceTitle": "Edge 2 - Reader","objectId": "bc000000-0000-0000-0000-000000000004","objectTitle": "Sample User - p00000000002","objectDescription": "Sample User - p00000000002","objectStereotype": "person","objectTypeId": "bc000000-0000-0000-0000-000000000005","objectTypeTitle": "Personnel Tag","trackedDeviceId": "bc000000-0000-0000-0000-000000000006","trackedDeviceTitle": "D00000000002","contactId": "bc000000-0000-0000-0000-000000000007","contactTitle": "Sample User - p00000000001","contactDescription": "Sample User - p00000000001","contactStereotype": "person","contactTypeId": "bc000000-0000-0000-0000-000000000008","contactTypeTitle": "Personnel Tag","contactDeviceId": "bc000000-0000-0000-0000-000000000009","contactDeviceTitle": "d00000000001","createdAt": "2020-07-30T12:45:09Z","timestamp": "2020-01-01T09:00:00Z","exitTimestamp": "2020-01-01T09:00:10Z","durationSeconds": 10,"localTimezoneOffset": "+10:00","timestampConflict": false,"duplicateId": "bc000000-0000-0000-0000-000000000010","reportedByPrimary": true,"proximity": "Contact","timeout": false,"onCharge": false,"timeSyncIssue": false,"minimumDistance": 1,"boundaryDistance": 1,"startSequenceNumber": 0,"endSequenceNumber": 255,"placeId": null,"source": null,"placeTypeId": null,"placeTitle": null}]
}
Tag Contact Log – By Primary Contact
API Request Overview
Endpoint | https://api.us.loop.bluecats.com/reports/logs/tagcontacts/{objectId} |
Method |
GET |
Pagination Type |
Next token |
Description |
Iterate through available logs by ordered by date (either log event timestamp – timestamp or log create/processed timestamp – createdAt |
Headers |
|
Example Query |
|
Request Parameters
Key |
Attributes |
Description |
objectId |
Path Parameter |
Filter by a primary contact (objectId) |
groupId |
Required |
Filter by Group e.g. Site/Department etc. |
from |
Optional |
Starting timestamp to return events from |
to |
Optional |
when ‘to’ is specified then the results will be ascending, otherwise they will be descending. |
limit |
Optional |
Maximum number of results to return |
next |
Optional |
Continuation token to paginate through results. When this value is populated in the response, it can be passed to subsequent requests to retrieve additional events. |
proximity |
Optional |
Nearby|Contact |
duplicates |
Optional |
|
invalidEvents |
Optional |
When |
contactId |
Optional |
Filter by secondary contact |
sortByTimestampAscending |
Optional |
|
minimumDurationSeconds |
Optional |
Minimum contact duration to include for individual logs |
objectStereotype |
Optional |
Filter results by the target object’s stereotype. Valid values are |
contactStereotype |
Optional |
Filter results by the target contact object’s stereotype. Valid values are |
Example Response Body
{"next": "2020-01-01T09:00:00Z_bc000000-0000-0000-0000-000000000000_bc000000-0000-0000-0000-000000000001","limit": 1,"items": [{"id": "bc000000-0000-0000-0000-000000000002","orgId": "bc000000-0000-0000-0000-000000000003","groupId": "bc000000-1000-0000-0000-000000000004","offloadDeviceId": "bc000000-0000-0000-0000-000000000005","offloadDeviceTitle": "Edge 2 - Reader","objectId": "bc000000-0000-0000-0000-000000000006","objectTitle": "Sample User - p00000000002","objectDescription": "Sample User - p00000000002","objectStereotype": "person","objectTypeId": "bc000000-0000-0000-0000-000000000007","objectTypeTitle": "Personnel Tag","trackedDeviceId": "bc000000-0000-0000-0000-000000000008","trackedDeviceTitle": "D00000000002","contactId": "bc000000-0000-0000-0000-000000000009","contactTitle": "Sample User - p00000000001","contactDescription": "Sample User - p00000000001","contactStereotype": "person","contactTypeId": "bc000000-0000-0000-0000-000000000010","contactTypeTitle": "Personnel Tag","contactDeviceId": "bc000000-0000-0000-0000-000000000011","contactDeviceTitle": "d00000000001","createdAt": "2020-07-30T12:45:09Z","timestamp": "2020-01-01T09:00:00Z","exitTimestamp": "2020-01-01T09:00:10Z","durationSeconds": 10,"localTimezoneOffset": "+10:00","timestampConflict": false,"duplicateId": "bc000000-0000-0000-0000-000000000012","reportedByPrimary": true,"proximity": "Contact","timeout": false,"onCharge": false,"timeSyncIssue": false,"minimumDistance": 1,"boundaryDistance": 1,"startSequenceNumber": 0,"endSequenceNumber": 255,"placeId": null,"source": null,"placeTypeId": null,"placeTitle": null}]
}
Contact Tracing Summary API
Overview
Tag Contacts are generated when two T2T tags enter within one of two ranges In Contact
or Nearby
. A Tag Contact Summary Log
is a record summarising the time the cards spent in range of each other. To query the data, the user requires an active Bearer Token
, organization id
and group id
, which can be obtained by the methods presented in the Token Generation API
section above.
Tag Contact Summary Log – By Organization/Group
API Request Overview
Endpoint |
/reports/summaries/tagcontacts |
Method |
GET |
Headers |
|
Pagination Type |
limit/offset |
request parameters
Key |
Attributes |
Description |
groupId* |
Required: True |
Filter by a Group |
from* |
Required: True |
Start date in local time |
to* |
Required: True |
End date in local time |
limit |
Required: False |
Maximum number of results to return |
offset |
Required: False |
Page offset. i.e. if limit = 10 and offset = 10, then returned results will start from 100th record |
minimumTotalDurationSeconds |
Required: False |
Minimum contact duration to include |
proximity |
Required: False |
Nearby|Contact |
groupbyPeriod |
Required: False |
|
objectStereotype |
Optional |
Filter results by the target object’s stereotype. Valid values are |
contactStereotype |
Optional |
Filter results by the target contact object’s stereotype. Valid values are |
example response body
{"offset": 0,"limit": 1,"total": 1,"items": [{"orgId": "bc000000-0000-0000-0000-000000000000","groupId": "bc000000-0000-0000-0000-000000000001","objectId": "bc000000-0000-0000-0000-000000000002","objectTitle": "Samlpe A","objectTypeId": "bc000000-0000-0000-0000-000000000003","objectTypeTitle": "Person","localPeriodFrom": "2020-09-04","localPeriodTo": "2020-09-25","localTimezoneOffset": -5.0,"objectStereotype": "person","contactStereotype": "person","proximity": [{"proximity": "contact","totalDurationSeconds": 157518,"totalContacts": 17,"uniqueContacts": 5},{"proximity": "nearby","totalDurationSeconds": 157533,"totalContacts": 18,"uniqueContacts": 5}]}]
}
Tag Contact Summary Log – By Primary
API Request Overview
Endpoint |
/reports/summaries/tagcontacts/{objectId} |
Method |
GET |
Headers |
|
Pagination Type |
limit/offset |
Request Parameters
Key |
Attributes |
Description |
Id* |
Path Parameter |
Filter by a primary contact (objectId) |
groupId* |
Required: True |
Filter by a Group |
contactId |
Required: False |
Filter by Secondary Contact ID |
from |
Required: True |
Start date in local time |
to |
Required: True |
End date in local time |
limit |
Required: False |
Maximum number of results to return |
offset |
Required: False |
Page offset. i.e. if limit = 10 and offset = 10, then returned results will start from 100th record |
minimumDurationSeconds |
Required: False |
Minimum contact duration to include |
proximity |
Required: True |
Nearby|Contact |
groupbyPeriod |
Required: False |
|
objectStereotype |
Optional |
Filter results by the target object’s stereotype. Valid values are |
contactStereotype |
Optional |
Filter results by the target contact object’s stereotype. Valid values are |
example response body
>
{"offset": 0,"limit": 1,"total": 1,"items": [{"orgId": "bc000000-0000-0000-0000-000000000000","groupId": "bc000000-0000-0000-0000-000000000001","objectId": "bc000000-0000-0000-0000-000000000002","objectTitle": "Samlpe A","objectTypeId": "bc000000-0000-0000-0000-000000000003","objectTypeTitle": "Person","localPeriodFrom": "2020-09-04","localPeriodTo": "2020-09-25","localTimezoneOffset": -5.0,"objectStereotype": "person","contactStereotype": "person","contactId": "bc000000-0000-0000-0000-000000000004","contactTitle": "Sample B","contactTypeId": "bc000000-0000-0000-0000-000000000005","contactTypeTitle": "Person","proximity": [{"proximity": "contact","totalDurationSeconds": 67,"totalContacts": 2,"uniqueContacts": 1},{"proximity": "nearby","totalDurationSeconds": 151,"totalContacts": 5,"uniqueContacts": 1}]}]
}