>  Switch To Link 5 and API v2 Documentation

Activities

Learn about the /activities endpoint.

An activity is a single unit of work performed by a user at a company.


#The activity object

An activity object may represent a single task, as a shift, a job, or a batch of tasks depending on the company.

Attributes
  • #
    idstring (uuid)

    Unique ID of the activity associated with a user's payroll account.

  • #
    accountstring (uuid)

    ID of the payroll account associated with the activity.

  • #
    employerstring

    The name of the company or entity that employs the user.

  • #
    data_partner *DEPRECATEDstring

    Deprecated in favor of link_item.

  • #
    complete_data_available *DEPRECATEDboolean

    Deprecated in favor of availability in the /accounts endpoint.

  • #
    statusstring (enum)

    The current state of this activity.

  • #
    typestring (enum)

    The type of activity that the worker undertook.

  • #
    circumstancesobject

    Activity-specific data attributes (metadata) provided by the Link item.

  • #
    num_tasksinteger

    The number of tasks performed. Will contain 1 if the activity object represents a single job (for example, a shift or trip). Will be 2 or more if the object represents an aggregate of tasks performed between start_datetime and end_datetime. It will contain null if the number of tasks performed is not known. This will be the case for companies that only provide aggregate data.

  • #
    created_atstring (timestamp)

    Time at which the activity object was created. Timestamps follow the ISO 8601 standard.

  • #
    updated_atstring (timestamp)

    Time at which the activity object was last updated. Timestamps follow the ISO 8601 standard.

  • #
    start_datestring (timestamp)

    Timestamp representing the start of the activity. Timestamps follow the ISO 8601 standard and are displayed in the UTC timezone.

  • #
    end_datestring (timestamp)

    Timestamp representing the end of the activity. Timestamps follow the ISO 8601 standard and are displayed in the UTC timezone.

  • #
    all_datetimesobject

    Same object as all_timestamps (see below), but all timestamps are converted to the ISO 8601 standard.

  • #
    all_timestampsobject

    The various timestamps of events inside of the activity.

    The time formatting of properties within all_timestamps can vary depending on the payroll provider. See all_datetimes for values formatted according to the ISO 8601 standard.

  • #
    shift_startstring (datetime)

    Timestamp (ISO 8601) when the work shift started.

  • #
    shift_endstring (datetime)

    Timestamp (ISO 8601) when the work shift ended.

  • #
    break_startstring (datetime)

    Timestamp (ISO 8601) when the break started.

  • #
    break_endstring (datetime)

    Timestamp (ISO 8601) when the break ended.

  • #
    breaksarray of objects

    Returns a list of all breaks and when they started and ended.

    The first object in the array will have the same start time as break_start and the same end time as break_end.

  • #
    request_atstring (datetime)

    Timestamp (ISO 8601) when the gig assignment was created.

  • #
    accept_atstring (datetime)

    Timestamp (ISO 8601) when the gig assignment was accepted.

  • #
    pickup_atstring (datetime)

    Timestamp (ISO 8601) when "package" (rider, food, or similar) was obtained.

  • #
    dropoff_atstring (datetime)

    Timestamp (ISO 8601) when "package" (rider, food, or similar) was delivered.

  • #
    cancel_atstring (datetime)

    Timestamp (ISO 8601) when the gig assignment was cancelled.

  • #
    durationinteger

    Duration time for the activity, displayed in seconds.

  • #
    timezonestring (timezone)

    The timezone of the activity. A list of possible time zone values is maintained at the IANA Time Zone Database.

  • #
    earning_typestring (enum)

    The reason for specific earning. Not all earnings are due to activities. Some are just bonuses after the fact, some are incentives to work on peak hours, etc.

  • #
    incomeobject

    Contains information about the amount earned for an activity.

  • #
    currencystring

    Currency the income was received in—for example USD, EUR. Currencies follow the ISO 4217 format.

  • #
    total_chargestring

    The amount the company associated with the Link Item has charged for an activity (inclusive of any fees).

    • total_charge = fees + total

  • #
    feesstring

    Fees charged by the company associated with the Link Item (for example, Udre) for an activity assigned to the user.

  • #
    totalstring

    Total amount received for this activity by a user: the sum of pay, tips, and bonus.

  • #
    paystring

    The amount received for the job excluding tips, bonus, and fees.

  • #
    tipsstring

    The amount of tips received for the activity.

  • #
    bonusstring

    The amount of bonus payment received for the activity.

  • #
    income_ratesobject

    Contains income earned at a per hour and per mile rate.

    This value is not calculated, and is only returned if directly available from the payroll provider.

  • #
    hourstring

    Income earned per hour.

  • #
    milestring

    Income earned per mile.

  • #
    start_locationobject

    Geographical information for activity's start location.

  • #
    latstring

    The geographic latitude of where the activity started.

  • #
    lngstring

    The geographic longitude of where the activity started.

  • #
    formatted_addressstring

    Full address of where the activity started.

  • #
    end_locationobject

    Geographical information for activity's end location.

  • #
    latstring

    The geographic latitude of where the activity ended.

  • #
    lngstring

    The geographic longitude of where the activity ended.

  • #
    formatted_addressstring

    Full address of where the activity ended.

  • #
    routestring

    URL to the payroll provider page that contains the route of the activity.

  • #
    distancestring

    Distance traveled during the activity.

  • #
    distance_unitstring (enum)

    Distance measurement unit for the activity — either miles or km.

  • #
    metadataobject

    Holds additional available, often unstructured, information about this data resource.



Example
1{
2  "id": "da332189-a115-484e-b60b-36ec2d5481d5",
3  "account": "9bb0ec90-03b1-4f8a-a72e-8f9f44a2f707",
4  "employer": "udre",
5  "link_item": "udre",
6  "created_at": "2022-10-20T15:54:07.360Z",
7  "updated_at": "2022-10-20T15:54:07.360Z",
8  "status": "completed",
9  "type": "rideshare",
10  "circumstances": {
11    "is_pool": false,
12    "is_rush": false,
13    "is_surge": false,
14    "service_type": "UdreX"
15  },
16  "num_tasks": 1,
17  "start_date": "2022-10-20T12:35:11Z",
18  "end_date": "2022-10-20T13:15:56Z",
19  "all_timestamps": {
20    "request_at": 1666269311,
21    "accept_at": 1666269315,
22    "pickup_at": 1666269776,
23    "dropoff_at": 1666271756,
24    "cancel_at": null,
25    "shift_start": null,
26    "shift_end": null,
27    "break_start": null,
28    "break_end": null,
29    "breaks": []
30  },
31  "all_datetimes": {
32    "request_at": "2022-10-20T12:35:11Z",
33    "accept_at": "2022-10-20T12:35:15Z",
34    "pickup_at": "2022-10-20T12:42:56Z",
35    "dropoff_at": "2022-10-20T13:15:56Z",
36    "cancel_at": null,
37    "shift_start": null,
38    "shift_end": null,
39    "break_start": null,
40    "break_end": null,
41    "breaks": []
42  },
43  "duration": 1618,
44  "timezone": "America/Chicago",
45  "earning_type": "work",
46  "income": {
47    "currency": "USD",
48    "total_charge": "18.27",
49    "fees": "0.00",
50    "total": "18.27",
51    "pay": "18.27",
52    "tips": "0.00",
53    "bonus": "0.00"
54  },
55  "income_rates": {
56    "hour": "56.75",
57    "mile": "8.32"
58  },
59  "start_location": {
60    "lat": "42.58294677734375",
61    "lng": "-77.70906829833984",
62    "formatted_address": "10th St, Country Club Hills, IL 60478, USA"
63  },
64  "end_location": {
65    "lat": "42.809085845947266",
66    "lng": "-77.82435607910156",
67    "formatted_address": "Clay Terrace, Lyons, IL 60534, USA"
68  },
69  "route": "https://partners.udre.com/p3/payments/trips/dde4c587-ffcf-4245-b414-781dcef483a1?in_app=true",
70  "distance": "25.95",
71  "distance_unit": "miles",
72  "metadata": {
73    "totalActualMileage": 25.95,
74    "totalPlannedMileage": 26.33
75  }
76}

#Retrieve an activity

get/v1/activities/{id}
  • Retrieve an activity object with the supplied ID.
  • This request returns an activity object if a valid identifier was provided.
Path parameters
  • #
    idstring (uuid)
    required

    The identifier of the activity object to be retrieved.

Example Request
1curl --request GET \
2     --url https://api.argyle.com/v1/activities/{id} \
3     --header 'accept: application/json' \
4     --header 'content-type: application/json'
Example Response
1{
2  "id": "za332989-2315-48k1-b67y-36ec2d5481a1",
3  "account": "1ee3ec90-0431-4fqa-a56e-8f9k74a2f707",
4  "employer": "wellmart",
5  "link_item": "wellmart",
6  "created_at": "2020-04-01T14:13:47.804149Z",
7  "updated_at": "2020-04-02T08:15:15.635636Z",
8  "status": "completed",
9  "type": "hourly",
10  "circumstances": {
11    "outside_of_prefered_hours": true
12  },
13  "num_tasks": 1,
14  "start_date": "2020-04-01T08:05:12Z",
15  "end_date": "2020-04-01T17:05:56Z",
16  "all_timestamps": {
17    "request_at": null,
18    "accept_at": null,
19    "pickup_at": null,
20    "dropoff_at": null,
21    "cancel_at": null,
22    "shift_start": 1585728312,
23    "break_start": 1585744704,
24    "break_end": 1585746322,
25    "breaks": [
26      {
27        "break_start": 1585744704,
28        "break_end": 1585746322
29      },
30      {
31        "break_start": 1585744714,
32        "break_end": 1585746332
33      }
34    ],
35    "shift_end": 1585760756
36  },
37  "all_datetimes": {
38    "request_at": null,
39    "accept_at": null,
40    "pickup_at": null,
41    "dropoff_at": null,
42    "cancel_at": null,
43    "shift_start": "2020-04-01T08:05:12Z",
44    "break_start": "2020-04-01T12:38:24Z",
45    "break_end": "2020-04-01T13:05:22Z",
46    "breaks": [
47      {
48        "break_start": "2020-04-01T12:38:24Z",
49        "break_end": "2020-04-01T13:05:22Z"
50      },
51      {
52        "break_start": "2020-04-01T15:22:13Z",
53        "break_end": "2020-04-01T15:51:59Z"
54      }
55    ],
56    "shift_end": "2020-04-01T17:05:56Z"
57  },
58  "duration": 32444,
59  "timezone": "America/Chicago",
60  "earning_type": "work",
61  "income": {
62    "currency": "USD",
63    "total_charge": null,
64    "fees": null,
65    "total": "180.00",
66    "pay": "180.00",
67    "tips": null,
68    "bonus": null
69  },
70  "income_rates": {
71    "hour": null,
72    "mile": null
73  },
74  "start_location": null,
75  "end_location": null,
76  "route": null,
77  "distance": null,
78  "distance_unit": null,
79  "metadata": {}
80}

#List activities

get/v1/activities
  • List all activities ordered by start_date. Filter them by date range, account, or user ID.
  • This request returns an object with a results property that contains an array of up to limit activities objects.
Query parameters
  • #
    accountstring (uuid)
    optional

    Return only activities for the account with the provided ID.

  • #
    userstring (uuid)
    optional

    Return only activities for the user with the provided ID.

  • #
    from_start_datestring
    optional

    Return only activities with start_date on or after the provided timestamp. Timestamps with dates conforming to the ISO 8601 standard are accepted.

  • #
    to_start_datestring
    optional

    Return only activities with start_date on or before the provided timestamp. Timestamps with dates conforming to the ISO 8601 standard are accepted.

  • #
    limitinteger
    optional

    The number of activities objects to be returned. The default is 10. Max value is 200.

Example Request
1curl --request GET \
2     --url https://api.argyle.com/v1/activities?limit=2 \
3     --header 'accept: application/json' \
4     --header 'content-type: application/json'
Example Response
1[
2  {
3    "id": "0180519e-6e3f-fcdc-27e8-802b2c098986",
4    "account": "0180519e-64f5-0107-603a-a460f85c2c50",
5    "employer": "amazin",
6    "link_item": "amazin",
7    "data_partner": "amazin",
8    "created_at": "2022-04-22T14:12:59.184Z",
9    "updated_at": "2022-04-22T14:12:59.184Z",
10    "status": "completed",
11    "type": "hourly",
12    "num_tasks": 1,
13    "start_date": "2022-04-21T14:12:58Z",
14    "end_date": "2022-04-21T22:12:58Z",
15    "all_timestamps": {
16      "dropoff_at": null,
17      "pickup_at": null,
18      "request_at": null,
19      "shift_start": 1650550378,
20      "shift_end": 1650579178,
21      "break_start": 1650563338,
22      "break_end": 1650566218
23    },
24    "all_datetimes": {
25      "dropoff_at": null,
26      "pickup_at": null,
27      "request_at": null,
28      "shift_start": "2022-04-21T14:12:58Z",
29      "shift_end": "2022-04-21T22:12:58Z",
30      "break_start": "2022-04-21T17:48:58Z",
31      "break_end": "2022-04-21T18:36:58Z"
32    },
33    "duration": 25920,
34    "timezone": "America/Los_Angeles",
35    "earning_type": "work",
36    "start_location": null,
37    "end_location": null,
38    "route": null,
39    "distance": null,
40    "distance_unit": null,
41    "complete_data_available": true,
42    "metadata": {},
43    "circumstances": {
44      "is_pool": null,
45      "is_rush": null,
46      "is_surge": null,
47      "service_type": null,
48      "position": null
49    },
50    "income": {
51      "currency": "USD",
52      "total_charge": null,
53      "fees": null,
54      "total": "42.00",
55      "pay": "42.00",
56      "tips": null,
57      "bonus": null,
58      "taxes": null
59    },
60    "income_rates": {
61      "hour": "6.00",
62      "mile": null
63    }
64  },
65  {
66    "id": "018050e7-f9bb-5046-0e33-747c94ceb9fb",
67    "account": "018050e7-f083-eb25-1648-eb97aca69039",
68    "employer": "newtube",
69    "link_item": "newtube",
70    "data_partner": "newtube",
71    "created_at": "2022-04-22T10:53:41.790Z",
72    "updated_at": "2022-04-22T10:53:41.790Z",
73    "status": "completed",
74    "type": "hourly",
75    "num_tasks": 1,
76    "start_date": "2022-04-21T10:53:41Z",
77    "end_date": "2022-04-21T18:53:41Z",
78    "all_timestamps": {
79      "dropoff_at": null,
80      "pickup_at": null,
81      "request_at": null,
82      "shift_start": 1650538421,
83      "shift_end": 1650567221,
84      "break_start": 1650551381,
85      "break_end": 1650554261
86    },
87    "all_datetimes": {
88      "dropoff_at": null,
89      "pickup_at": null,
90      "request_at": null,
91      "shift_start": "2022-04-21T10:53:41Z",
92      "shift_end": "2022-04-21T18:53:41Z",
93      "break_start": "2022-04-21T14:29:41Z",
94      "break_end": "2022-04-21T15:17:41Z"
95    },
96    "duration": 25920,
97    "timezone": "America/Los_Angeles",
98    "earning_type": "work",
99    "start_location": null,
100    "end_location": null,
101    "route": null,
102    "distance": null,
103    "distance_unit": null,
104    "complete_data_available": true,
105    "metadata": {},
106    "circumstances": {
107      "is_pool": null,
108      "is_rush": null,
109      "is_surge": null,
110      "service_type": null,
111      "position": null
112    },
113    "income": {
114      "currency": "USD",
115      "total_charge": null,
116      "fees": null,
117      "total": "238.00",
118      "pay": "238.00",
119      "tips": null,
120      "bonus": null,
121      "taxes": null
122    },
123    "income_rates": {
124      "hour": "34.00",
125      "mile": null
126    }
127  }
128]
Updating Argyle status...
© 2024 Argyle Systems Inc.argyle.com