Chilkat Online Tools

SQL Server / Support API / List Activities

Back to Collection Items

-- Important: See this note about string length limitations for strings returned by sp_OAMethod calls.
--
CREATE PROCEDURE ChilkatSample
AS
BEGIN
    DECLARE @hr int
    DECLARE @iTmp0 int
    -- Important: Do not use nvarchar(max).  See the warning about using nvarchar(max).
    DECLARE @sTmp0 nvarchar(4000)
    -- This example assumes the Chilkat API to have been previously unlocked.
    -- See Global Unlock Sample for sample code.

    DECLARE @http int
    -- Use "Chilkat_9_5_0.Http" for versions of Chilkat < 10.0.0
    EXEC @hr = sp_OACreate 'Chilkat.Http', @http OUT
    IF @hr <> 0
    BEGIN
        PRINT 'Failed to create ActiveX component'
        RETURN
    END

    DECLARE @success int

    EXEC sp_OASetProperty @http, 'BasicAuth', 1
    EXEC sp_OASetProperty @http, 'Login', 'login'
    EXEC sp_OASetProperty @http, 'Password', 'password'

    DECLARE @queryParams int
    -- Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0
    EXEC @hr = sp_OACreate 'Chilkat.JsonObject', @queryParams OUT

    EXEC sp_OAMethod @queryParams, 'UpdateString', @success OUT, 'since', '<string>'

    EXEC sp_OAMethod @http, 'SetRequestHeader', NULL, 'Accept', 'application/json'

    DECLARE @resp int
    EXEC sp_OAMethod @http, 'QuickRequestParams', @resp OUT, 'GET', 'https://example.zendesk.com/api/v2/activities', @queryParams
    EXEC sp_OAGetProperty @http, 'LastMethodSuccess', @iTmp0 OUT
    IF @iTmp0 = 0
      BEGIN
        EXEC sp_OAGetProperty @http, 'LastErrorText', @sTmp0 OUT
        PRINT @sTmp0
        EXEC @hr = sp_OADestroy @http
        EXEC @hr = sp_OADestroy @queryParams
        RETURN
      END

    DECLARE @sbResponseBody int
    -- Use "Chilkat_9_5_0.StringBuilder" for versions of Chilkat < 10.0.0
    EXEC @hr = sp_OACreate 'Chilkat.StringBuilder', @sbResponseBody OUT

    EXEC sp_OAMethod @resp, 'GetBodySb', @success OUT, @sbResponseBody

    DECLARE @jResp int
    -- Use "Chilkat_9_5_0.JsonObject" for versions of Chilkat < 10.0.0
    EXEC @hr = sp_OACreate 'Chilkat.JsonObject', @jResp OUT

    EXEC sp_OAMethod @jResp, 'LoadSb', @success OUT, @sbResponseBody
    EXEC sp_OASetProperty @jResp, 'EmitCompact', 0


    PRINT 'Response Body:'
    EXEC sp_OAMethod @jResp, 'Emit', @sTmp0 OUT
    PRINT @sTmp0

    DECLARE @respStatusCode int
    EXEC sp_OAGetProperty @resp, 'StatusCode', @respStatusCode OUT

    PRINT 'Response Status Code = ' + @respStatusCode
    IF @respStatusCode >= 400
      BEGIN

        PRINT 'Response Header:'
        EXEC sp_OAGetProperty @resp, 'Header', @sTmp0 OUT
        PRINT @sTmp0

        PRINT 'Failed.'
        EXEC @hr = sp_OADestroy @resp

        EXEC @hr = sp_OADestroy @http
        EXEC @hr = sp_OADestroy @queryParams
        EXEC @hr = sp_OADestroy @sbResponseBody
        EXEC @hr = sp_OADestroy @jResp
        RETURN
      END
    EXEC @hr = sp_OADestroy @resp

    -- Sample JSON response:
    -- (Sample code for parsing the JSON response is shown below)

    -- {
    --   "activities": [
    --     {
    --       "actor": {
    --         "name": "<string>",
    --         "active": "<boolean>",
    --         "alias": "<string>",
    --         "chat_only": "<boolean>",
    --         "created_at": "<string>",
    --         "custom_role_id": "<integer>",
    --         "default_group_id": "<integer>",
    --         "details": "<string>",
    --         "email": "<string>",
    --         "external_id": "<string>",
    --         "iana_time_zone": "<string>",
    --         "id": "<integer>",
    --         "last_login_at": "<string>",
    --         "locale": "<string>",
    --         "locale_id": "<integer>",
    --         "moderator": "<boolean>",
    --         "notes": "<string>",
    --         "only_private_comments": "<boolean>",
    --         "organization_id": "<integer>",
    --         "phone": "<string>",
    --         "photo": {
    --           "adipisicing7": 56151302,
    --           "irure_70": true
    --         },
    --         "remote_photo_url": "<string>",
    --         "report_csv": "<boolean>",
    --         "restricted_agent": "<boolean>",
    --         "role": "<string>",
    --         "role_type": "<integer>",
    --         "shared": "<boolean>",
    --         "shared_agent": "<boolean>",
    --         "shared_phone_number": "<boolean>",
    --         "signature": "<string>",
    --         "suspended": "<boolean>",
    --         "tags": "<array>",
    --         "ticket_restriction": "<string>",
    --         "time_zone": "<string>",
    --         "two_factor_auth_enabled": "<boolean>",
    --         "updated_at": "<string>",
    --         "url": "<string>",
    --         "user_fields": {
    --           "tempor_f": 85786252.44695336
    --         },
    --         "verified": "<boolean>"
    --       },
    --       "actor_id": "<integer>",
    --       "created_at": "<string>",
    --       "id": "<integer>",
    --       "object": {
    --         "officia1a2": true,
    --         "qui9": "voluptate mollit Excepteur ipsum veniam",
    --         "irure_1cd": "id ea"
    --       },
    --       "target": {
    --         "sede8": false
    --       },
    --       "title": "<string>",
    --       "updated_at": "<string>",
    --       "url": "<string>",
    --       "user": {
    --         "name": "<string>",
    --         "active": "<boolean>",
    --         "alias": "<string>",
    --         "chat_only": "<boolean>",
    --         "created_at": "<string>",
    --         "custom_role_id": "<integer>",
    --         "default_group_id": "<integer>",
    --         "details": "<string>",
    --         "email": "<string>",
    --         "external_id": "<string>",
    --         "iana_time_zone": "<string>",
    --         "id": "<integer>",
    --         "last_login_at": "<string>",
    --         "locale": "<string>",
    --         "locale_id": "<integer>",
    --         "moderator": "<boolean>",
    --         "notes": "<string>",
    --         "only_private_comments": "<boolean>",
    --         "organization_id": "<integer>",
    --         "phone": "<string>",
    --         "photo": {
    --           "Ut975": -74534220.66145113,
    --           "magna3e": false
    --         },
    --         "remote_photo_url": "<string>",
    --         "report_csv": "<boolean>",
    --         "restricted_agent": "<boolean>",
    --         "role": "<string>",
    --         "role_type": "<integer>",
    --         "shared": "<boolean>",
    --         "shared_agent": "<boolean>",
    --         "shared_phone_number": "<boolean>",
    --         "signature": "<string>",
    --         "suspended": "<boolean>",
    --         "tags": "<array>",
    --         "ticket_restriction": "<string>",
    --         "time_zone": "<string>",
    --         "two_factor_auth_enabled": "<boolean>",
    --         "updated_at": "<string>",
    --         "url": "<string>",
    --         "user_fields": {
    --           "ut_d": "tempor",
    --           "adipisicing_7": 28937910,
    --           "magna_9": -45754090.269199036
    --         },
    --         "verified": "<boolean>"
    --       },
    --       "user_id": "<integer>",
    --       "verb": "<string>"
    --     },
    --     {
    --       "actor": {
    --         "name": "<string>",
    --         "active": "<boolean>",
    --         "alias": "<string>",
    --         "chat_only": "<boolean>",
    --         "created_at": "<string>",
    --         "custom_role_id": "<integer>",
    --         "default_group_id": "<integer>",
    --         "details": "<string>",
    --         "email": "<string>",
    --         "external_id": "<string>",
    --         "iana_time_zone": "<string>",
    --         "id": "<integer>",
    --         "last_login_at": "<string>",
    --         "locale": "<string>",
    --         "locale_id": "<integer>",
    --         "moderator": "<boolean>",
    --         "notes": "<string>",
    --         "only_private_comments": "<boolean>",
    --         "organization_id": "<integer>",
    --         "phone": "<string>",
    --         "photo": {
    --           "aliquipb6": false
    --         },
    --         "remote_photo_url": "<string>",
    --         "report_csv": "<boolean>",
    --         "restricted_agent": "<boolean>",
    --         "role": "<string>",
    --         "role_type": "<integer>",
    --         "shared": "<boolean>",
    --         "shared_agent": "<boolean>",
    --         "shared_phone_number": "<boolean>",
    --         "signature": "<string>",
    --         "suspended": "<boolean>",
    --         "tags": "<array>",
    --         "ticket_restriction": "<string>",
    --         "time_zone": "<string>",
    --         "two_factor_auth_enabled": "<boolean>",
    --         "updated_at": "<string>",
    --         "url": "<string>",
    --         "user_fields": {
    --           "euc13": "pariatur"
    --         },
    --         "verified": "<boolean>"
    --       },
    --       "actor_id": "<integer>",
    --       "created_at": "<string>",
    --       "id": "<integer>",
    --       "object": {
    --         "pariatur_39": -13246316,
    --         "voluptate_8": false,
    --         "ipsum4": -24640571
    --       },
    --       "target": {
    --         "est_d": 43464084.60404679
    --       },
    --       "title": "<string>",
    --       "updated_at": "<string>",
    --       "url": "<string>",
    --       "user": {
    --         "name": "<string>",
    --         "active": "<boolean>",
    --         "alias": "<string>",
    --         "chat_only": "<boolean>",
    --         "created_at": "<string>",
    --         "custom_role_id": "<integer>",
    --         "default_group_id": "<integer>",
    --         "details": "<string>",
    --         "email": "<string>",
    --         "external_id": "<string>",
    --         "iana_time_zone": "<string>",
    --         "id": "<integer>",
    --         "last_login_at": "<string>",
    --         "locale": "<string>",
    --         "locale_id": "<integer>",
    --         "moderator": "<boolean>",
    --         "notes": "<string>",
    --         "only_private_comments": "<boolean>",
    --         "organization_id": "<integer>",
    --         "phone": "<string>",
    --         "photo": {
    --           "esse_b": "occaec",
    --           "ut_e6f": "Ut est deserunt"
    --         },
    --         "remote_photo_url": "<string>",
    --         "report_csv": "<boolean>",
    --         "restricted_agent": "<boolean>",
    --         "role": "<string>",
    --         "role_type": "<integer>",
    --         "shared": "<boolean>",
    --         "shared_agent": "<boolean>",
    --         "shared_phone_number": "<boolean>",
    --         "signature": "<string>",
    --         "suspended": "<boolean>",
    --         "tags": "<array>",
    --         "ticket_restriction": "<string>",
    --         "time_zone": "<string>",
    --         "two_factor_auth_enabled": "<boolean>",
    --         "updated_at": "<string>",
    --         "url": "<string>",
    --         "user_fields": {
    --           "voluptatef": -38514506.191917874,
    --           "utba9": -99737083,
    --           "ut_2": false
    --         },
    --         "verified": "<boolean>"
    --       },
    --       "user_id": "<integer>",
    --       "verb": "<string>"
    --     }
    --   ],
    --   "actors": [
    --     {
    --       "Excepteur1_": -85145004.89320306,
    --       "consectetura8a": -98072772.2193171,
    --       "id_e": -68362078.49006462,
    --       "reprehenderit_93": 96874887,
    --       "elit7": "dolor"
    --     },
    --     {
    --       "ad_1a": "sunt nulla incididunt sed"
    --     }
    --   ],
    --   "count": "<integer>",
    --   "next_page": "<string>",
    --   "previous_page": "<string>",
    --   "users": [
    --     {
    --       "anim40": -83874192,
    --       "quisa9": 17607150.376219943,
    --       "fugiat_e": true,
    --       "non_224": 21739369.8385354
    --     },
    --     {
    --       "cillumeb": "ut nisi sunt deserunt"
    --     }
    --   ]
    -- }

    -- Sample code for parsing the JSON response...
    -- Use this online tool to generate parsing code from sample JSON: Generate JSON Parsing Code

    DECLARE @Name nvarchar(4000)

    DECLARE @Active nvarchar(4000)

    DECLARE @Alias nvarchar(4000)

    DECLARE @Chat_only nvarchar(4000)

    DECLARE @Created_at nvarchar(4000)

    DECLARE @Custom_role_id nvarchar(4000)

    DECLARE @Default_group_id nvarchar(4000)

    DECLARE @Details nvarchar(4000)

    DECLARE @v_Email nvarchar(4000)

    DECLARE @External_id nvarchar(4000)

    DECLARE @Iana_time_zone nvarchar(4000)

    DECLARE @Id nvarchar(4000)

    DECLARE @Last_login_at nvarchar(4000)

    DECLARE @Locale nvarchar(4000)

    DECLARE @Locale_id nvarchar(4000)

    DECLARE @Moderator nvarchar(4000)

    DECLARE @Notes nvarchar(4000)

    DECLARE @Only_private_comments nvarchar(4000)

    DECLARE @Organization_id nvarchar(4000)

    DECLARE @Phone nvarchar(4000)

    DECLARE @Adipisicing7 int

    DECLARE @Irure_70 int

    DECLARE @Remote_photo_url nvarchar(4000)

    DECLARE @Report_csv nvarchar(4000)

    DECLARE @Restricted_agent nvarchar(4000)

    DECLARE @Role nvarchar(4000)

    DECLARE @Role_type nvarchar(4000)

    DECLARE @v_Shared nvarchar(4000)

    DECLARE @Shared_agent nvarchar(4000)

    DECLARE @Shared_phone_number nvarchar(4000)

    DECLARE @Signature nvarchar(4000)

    DECLARE @Suspended nvarchar(4000)

    DECLARE @Tags nvarchar(4000)

    DECLARE @Ticket_restriction nvarchar(4000)

    DECLARE @Time_zone nvarchar(4000)

    DECLARE @Two_factor_auth_enabled nvarchar(4000)

    DECLARE @Updated_at nvarchar(4000)

    DECLARE @v_Url nvarchar(4000)

    DECLARE @Tempor_f nvarchar(4000)

    DECLARE @Verified nvarchar(4000)

    DECLARE @actor_id nvarchar(4000)

    DECLARE @created_at nvarchar(4000)

    DECLARE @id nvarchar(4000)

    DECLARE @Officia1a2 int

    DECLARE @Qui9 nvarchar(4000)

    DECLARE @Irure_1cd nvarchar(4000)

    DECLARE @Sede8 int

    DECLARE @title nvarchar(4000)

    DECLARE @updated_at nvarchar(4000)

    DECLARE @url nvarchar(4000)

    DECLARE @userName nvarchar(4000)

    DECLARE @userActive nvarchar(4000)

    DECLARE @userAlias nvarchar(4000)

    DECLARE @userChat_only nvarchar(4000)

    DECLARE @userCreated_at nvarchar(4000)

    DECLARE @userCustom_role_id nvarchar(4000)

    DECLARE @userDefault_group_id nvarchar(4000)

    DECLARE @userDetails nvarchar(4000)

    DECLARE @userEmail nvarchar(4000)

    DECLARE @userExternal_id nvarchar(4000)

    DECLARE @userIana_time_zone nvarchar(4000)

    DECLARE @userId nvarchar(4000)

    DECLARE @userLast_login_at nvarchar(4000)

    DECLARE @userLocale nvarchar(4000)

    DECLARE @userLocale_id nvarchar(4000)

    DECLARE @userModerator nvarchar(4000)

    DECLARE @userNotes nvarchar(4000)

    DECLARE @userOnly_private_comments nvarchar(4000)

    DECLARE @userOrganization_id nvarchar(4000)

    DECLARE @userPhone nvarchar(4000)

    DECLARE @Ut975 nvarchar(4000)

    DECLARE @Magna3e int

    DECLARE @userRemote_photo_url nvarchar(4000)

    DECLARE @userReport_csv nvarchar(4000)

    DECLARE @userRestricted_agent nvarchar(4000)

    DECLARE @userRole nvarchar(4000)

    DECLARE @userRole_type nvarchar(4000)

    DECLARE @userShared nvarchar(4000)

    DECLARE @userShared_agent nvarchar(4000)

    DECLARE @userShared_phone_number nvarchar(4000)

    DECLARE @userSignature nvarchar(4000)

    DECLARE @userSuspended nvarchar(4000)

    DECLARE @userTags nvarchar(4000)

    DECLARE @userTicket_restriction nvarchar(4000)

    DECLARE @userTime_zone nvarchar(4000)

    DECLARE @userTwo_factor_auth_enabled nvarchar(4000)

    DECLARE @userUpdated_at nvarchar(4000)

    DECLARE @userUrl nvarchar(4000)

    DECLARE @Ut_d nvarchar(4000)

    DECLARE @Adipisicing_7 int

    DECLARE @Magna_9 nvarchar(4000)

    DECLARE @userVerified nvarchar(4000)

    DECLARE @user_id nvarchar(4000)

    DECLARE @verb nvarchar(4000)

    DECLARE @Aliquipb6 int

    DECLARE @Euc13 nvarchar(4000)

    DECLARE @Pariatur_39 int

    DECLARE @Voluptate_8 int

    DECLARE @Ipsum4 int

    DECLARE @Est_d nvarchar(4000)

    DECLARE @Esse_b nvarchar(4000)

    DECLARE @Ut_e6f nvarchar(4000)

    DECLARE @Voluptatef nvarchar(4000)

    DECLARE @Utba9 int

    DECLARE @Ut_2 int

    DECLARE @Excepteur1_ nvarchar(4000)

    DECLARE @consectetura8a nvarchar(4000)

    DECLARE @id_e nvarchar(4000)

    DECLARE @reprehenderit_93 int

    DECLARE @elit7 nvarchar(4000)

    DECLARE @ad_1a nvarchar(4000)

    DECLARE @anim40 int

    DECLARE @quisa9 nvarchar(4000)

    DECLARE @fugiat_e int

    DECLARE @non_224 nvarchar(4000)

    DECLARE @cillumeb nvarchar(4000)

    DECLARE @count nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @count OUT, 'count'
    DECLARE @next_page nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @next_page OUT, 'next_page'
    DECLARE @previous_page nvarchar(4000)
    EXEC sp_OAMethod @jResp, 'StringOf', @previous_page OUT, 'previous_page'
    DECLARE @i int
    SELECT @i = 0
    DECLARE @count_i int
    EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_i OUT, 'activities'
    WHILE @i < @count_i
      BEGIN
        EXEC sp_OASetProperty @jResp, 'I', @i
        EXEC sp_OAMethod @jResp, 'StringOf', @Name OUT, 'activities[i].actor.name'
        EXEC sp_OAMethod @jResp, 'StringOf', @Active OUT, 'activities[i].actor.active'
        EXEC sp_OAMethod @jResp, 'StringOf', @Alias OUT, 'activities[i].actor.alias'
        EXEC sp_OAMethod @jResp, 'StringOf', @Chat_only OUT, 'activities[i].actor.chat_only'
        EXEC sp_OAMethod @jResp, 'StringOf', @Created_at OUT, 'activities[i].actor.created_at'
        EXEC sp_OAMethod @jResp, 'StringOf', @Custom_role_id OUT, 'activities[i].actor.custom_role_id'
        EXEC sp_OAMethod @jResp, 'StringOf', @Default_group_id OUT, 'activities[i].actor.default_group_id'
        EXEC sp_OAMethod @jResp, 'StringOf', @Details OUT, 'activities[i].actor.details'
        EXEC sp_OAMethod @jResp, 'StringOf', @v_Email OUT, 'activities[i].actor.email'
        EXEC sp_OAMethod @jResp, 'StringOf', @External_id OUT, 'activities[i].actor.external_id'
        EXEC sp_OAMethod @jResp, 'StringOf', @Iana_time_zone OUT, 'activities[i].actor.iana_time_zone'
        EXEC sp_OAMethod @jResp, 'StringOf', @Id OUT, 'activities[i].actor.id'
        EXEC sp_OAMethod @jResp, 'StringOf', @Last_login_at OUT, 'activities[i].actor.last_login_at'
        EXEC sp_OAMethod @jResp, 'StringOf', @Locale OUT, 'activities[i].actor.locale'
        EXEC sp_OAMethod @jResp, 'StringOf', @Locale_id OUT, 'activities[i].actor.locale_id'
        EXEC sp_OAMethod @jResp, 'StringOf', @Moderator OUT, 'activities[i].actor.moderator'
        EXEC sp_OAMethod @jResp, 'StringOf', @Notes OUT, 'activities[i].actor.notes'
        EXEC sp_OAMethod @jResp, 'StringOf', @Only_private_comments OUT, 'activities[i].actor.only_private_comments'
        EXEC sp_OAMethod @jResp, 'StringOf', @Organization_id OUT, 'activities[i].actor.organization_id'
        EXEC sp_OAMethod @jResp, 'StringOf', @Phone OUT, 'activities[i].actor.phone'
        EXEC sp_OAMethod @jResp, 'IntOf', @Adipisicing7 OUT, 'activities[i].actor.photo.adipisicing7'
        EXEC sp_OAMethod @jResp, 'BoolOf', @Irure_70 OUT, 'activities[i].actor.photo.irure_70'
        EXEC sp_OAMethod @jResp, 'StringOf', @Remote_photo_url OUT, 'activities[i].actor.remote_photo_url'
        EXEC sp_OAMethod @jResp, 'StringOf', @Report_csv OUT, 'activities[i].actor.report_csv'
        EXEC sp_OAMethod @jResp, 'StringOf', @Restricted_agent OUT, 'activities[i].actor.restricted_agent'
        EXEC sp_OAMethod @jResp, 'StringOf', @Role OUT, 'activities[i].actor.role'
        EXEC sp_OAMethod @jResp, 'StringOf', @Role_type OUT, 'activities[i].actor.role_type'
        EXEC sp_OAMethod @jResp, 'StringOf', @v_Shared OUT, 'activities[i].actor.shared'
        EXEC sp_OAMethod @jResp, 'StringOf', @Shared_agent OUT, 'activities[i].actor.shared_agent'
        EXEC sp_OAMethod @jResp, 'StringOf', @Shared_phone_number OUT, 'activities[i].actor.shared_phone_number'
        EXEC sp_OAMethod @jResp, 'StringOf', @Signature OUT, 'activities[i].actor.signature'
        EXEC sp_OAMethod @jResp, 'StringOf', @Suspended OUT, 'activities[i].actor.suspended'
        EXEC sp_OAMethod @jResp, 'StringOf', @Tags OUT, 'activities[i].actor.tags'
        EXEC sp_OAMethod @jResp, 'StringOf', @Ticket_restriction OUT, 'activities[i].actor.ticket_restriction'
        EXEC sp_OAMethod @jResp, 'StringOf', @Time_zone OUT, 'activities[i].actor.time_zone'
        EXEC sp_OAMethod @jResp, 'StringOf', @Two_factor_auth_enabled OUT, 'activities[i].actor.two_factor_auth_enabled'
        EXEC sp_OAMethod @jResp, 'StringOf', @Updated_at OUT, 'activities[i].actor.updated_at'
        EXEC sp_OAMethod @jResp, 'StringOf', @v_Url OUT, 'activities[i].actor.url'
        EXEC sp_OAMethod @jResp, 'StringOf', @Tempor_f OUT, 'activities[i].actor.user_fields.tempor_f'
        EXEC sp_OAMethod @jResp, 'StringOf', @Verified OUT, 'activities[i].actor.verified'
        EXEC sp_OAMethod @jResp, 'StringOf', @actor_id OUT, 'activities[i].actor_id'
        EXEC sp_OAMethod @jResp, 'StringOf', @created_at OUT, 'activities[i].created_at'
        EXEC sp_OAMethod @jResp, 'StringOf', @id OUT, 'activities[i].id'
        EXEC sp_OAMethod @jResp, 'BoolOf', @Officia1a2 OUT, 'activities[i].object.officia1a2'
        EXEC sp_OAMethod @jResp, 'StringOf', @Qui9 OUT, 'activities[i].object.qui9'
        EXEC sp_OAMethod @jResp, 'StringOf', @Irure_1cd OUT, 'activities[i].object.irure_1cd'
        EXEC sp_OAMethod @jResp, 'BoolOf', @Sede8 OUT, 'activities[i].target.sede8'
        EXEC sp_OAMethod @jResp, 'StringOf', @title OUT, 'activities[i].title'
        EXEC sp_OAMethod @jResp, 'StringOf', @updated_at OUT, 'activities[i].updated_at'
        EXEC sp_OAMethod @jResp, 'StringOf', @url OUT, 'activities[i].url'
        EXEC sp_OAMethod @jResp, 'StringOf', @userName OUT, 'activities[i].user.name'
        EXEC sp_OAMethod @jResp, 'StringOf', @userActive OUT, 'activities[i].user.active'
        EXEC sp_OAMethod @jResp, 'StringOf', @userAlias OUT, 'activities[i].user.alias'
        EXEC sp_OAMethod @jResp, 'StringOf', @userChat_only OUT, 'activities[i].user.chat_only'
        EXEC sp_OAMethod @jResp, 'StringOf', @userCreated_at OUT, 'activities[i].user.created_at'
        EXEC sp_OAMethod @jResp, 'StringOf', @userCustom_role_id OUT, 'activities[i].user.custom_role_id'
        EXEC sp_OAMethod @jResp, 'StringOf', @userDefault_group_id OUT, 'activities[i].user.default_group_id'
        EXEC sp_OAMethod @jResp, 'StringOf', @userDetails OUT, 'activities[i].user.details'
        EXEC sp_OAMethod @jResp, 'StringOf', @userEmail OUT, 'activities[i].user.email'
        EXEC sp_OAMethod @jResp, 'StringOf', @userExternal_id OUT, 'activities[i].user.external_id'
        EXEC sp_OAMethod @jResp, 'StringOf', @userIana_time_zone OUT, 'activities[i].user.iana_time_zone'
        EXEC sp_OAMethod @jResp, 'StringOf', @userId OUT, 'activities[i].user.id'
        EXEC sp_OAMethod @jResp, 'StringOf', @userLast_login_at OUT, 'activities[i].user.last_login_at'
        EXEC sp_OAMethod @jResp, 'StringOf', @userLocale OUT, 'activities[i].user.locale'
        EXEC sp_OAMethod @jResp, 'StringOf', @userLocale_id OUT, 'activities[i].user.locale_id'
        EXEC sp_OAMethod @jResp, 'StringOf', @userModerator OUT, 'activities[i].user.moderator'
        EXEC sp_OAMethod @jResp, 'StringOf', @userNotes OUT, 'activities[i].user.notes'
        EXEC sp_OAMethod @jResp, 'StringOf', @userOnly_private_comments OUT, 'activities[i].user.only_private_comments'
        EXEC sp_OAMethod @jResp, 'StringOf', @userOrganization_id OUT, 'activities[i].user.organization_id'
        EXEC sp_OAMethod @jResp, 'StringOf', @userPhone OUT, 'activities[i].user.phone'
        EXEC sp_OAMethod @jResp, 'StringOf', @Ut975 OUT, 'activities[i].user.photo.Ut975'
        EXEC sp_OAMethod @jResp, 'BoolOf', @Magna3e OUT, 'activities[i].user.photo.magna3e'
        EXEC sp_OAMethod @jResp, 'StringOf', @userRemote_photo_url OUT, 'activities[i].user.remote_photo_url'
        EXEC sp_OAMethod @jResp, 'StringOf', @userReport_csv OUT, 'activities[i].user.report_csv'
        EXEC sp_OAMethod @jResp, 'StringOf', @userRestricted_agent OUT, 'activities[i].user.restricted_agent'
        EXEC sp_OAMethod @jResp, 'StringOf', @userRole OUT, 'activities[i].user.role'
        EXEC sp_OAMethod @jResp, 'StringOf', @userRole_type OUT, 'activities[i].user.role_type'
        EXEC sp_OAMethod @jResp, 'StringOf', @userShared OUT, 'activities[i].user.shared'
        EXEC sp_OAMethod @jResp, 'StringOf', @userShared_agent OUT, 'activities[i].user.shared_agent'
        EXEC sp_OAMethod @jResp, 'StringOf', @userShared_phone_number OUT, 'activities[i].user.shared_phone_number'
        EXEC sp_OAMethod @jResp, 'StringOf', @userSignature OUT, 'activities[i].user.signature'
        EXEC sp_OAMethod @jResp, 'StringOf', @userSuspended OUT, 'activities[i].user.suspended'
        EXEC sp_OAMethod @jResp, 'StringOf', @userTags OUT, 'activities[i].user.tags'
        EXEC sp_OAMethod @jResp, 'StringOf', @userTicket_restriction OUT, 'activities[i].user.ticket_restriction'
        EXEC sp_OAMethod @jResp, 'StringOf', @userTime_zone OUT, 'activities[i].user.time_zone'
        EXEC sp_OAMethod @jResp, 'StringOf', @userTwo_factor_auth_enabled OUT, 'activities[i].user.two_factor_auth_enabled'
        EXEC sp_OAMethod @jResp, 'StringOf', @userUpdated_at OUT, 'activities[i].user.updated_at'
        EXEC sp_OAMethod @jResp, 'StringOf', @userUrl OUT, 'activities[i].user.url'
        EXEC sp_OAMethod @jResp, 'StringOf', @Ut_d OUT, 'activities[i].user.user_fields.ut_d'
        EXEC sp_OAMethod @jResp, 'IntOf', @Adipisicing_7 OUT, 'activities[i].user.user_fields.adipisicing_7'
        EXEC sp_OAMethod @jResp, 'StringOf', @Magna_9 OUT, 'activities[i].user.user_fields.magna_9'
        EXEC sp_OAMethod @jResp, 'StringOf', @userVerified OUT, 'activities[i].user.verified'
        EXEC sp_OAMethod @jResp, 'StringOf', @user_id OUT, 'activities[i].user_id'
        EXEC sp_OAMethod @jResp, 'StringOf', @verb OUT, 'activities[i].verb'
        EXEC sp_OAMethod @jResp, 'BoolOf', @Aliquipb6 OUT, 'activities[i].actor.photo.aliquipb6'
        EXEC sp_OAMethod @jResp, 'StringOf', @Euc13 OUT, 'activities[i].actor.user_fields.euc13'
        EXEC sp_OAMethod @jResp, 'IntOf', @Pariatur_39 OUT, 'activities[i].object.pariatur_39'
        EXEC sp_OAMethod @jResp, 'BoolOf', @Voluptate_8 OUT, 'activities[i].object.voluptate_8'
        EXEC sp_OAMethod @jResp, 'IntOf', @Ipsum4 OUT, 'activities[i].object.ipsum4'
        EXEC sp_OAMethod @jResp, 'StringOf', @Est_d OUT, 'activities[i].target.est_d'
        EXEC sp_OAMethod @jResp, 'StringOf', @Esse_b OUT, 'activities[i].user.photo.esse_b'
        EXEC sp_OAMethod @jResp, 'StringOf', @Ut_e6f OUT, 'activities[i].user.photo.ut_e6f'
        EXEC sp_OAMethod @jResp, 'StringOf', @Voluptatef OUT, 'activities[i].user.user_fields.voluptatef'
        EXEC sp_OAMethod @jResp, 'IntOf', @Utba9 OUT, 'activities[i].user.user_fields.utba9'
        EXEC sp_OAMethod @jResp, 'BoolOf', @Ut_2 OUT, 'activities[i].user.user_fields.ut_2'
        SELECT @i = @i + 1
      END
    SELECT @i = 0
    EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_i OUT, 'actors'
    WHILE @i < @count_i
      BEGIN
        EXEC sp_OASetProperty @jResp, 'I', @i
        EXEC sp_OAMethod @jResp, 'StringOf', @Excepteur1_ OUT, 'actors[i].Excepteur1_'
        EXEC sp_OAMethod @jResp, 'StringOf', @consectetura8a OUT, 'actors[i].consectetura8a'
        EXEC sp_OAMethod @jResp, 'StringOf', @id_e OUT, 'actors[i].id_e'
        EXEC sp_OAMethod @jResp, 'IntOf', @reprehenderit_93 OUT, 'actors[i].reprehenderit_93'
        EXEC sp_OAMethod @jResp, 'StringOf', @elit7 OUT, 'actors[i].elit7'
        EXEC sp_OAMethod @jResp, 'StringOf', @ad_1a OUT, 'actors[i].ad_1a'
        SELECT @i = @i + 1
      END
    SELECT @i = 0
    EXEC sp_OAMethod @jResp, 'SizeOfArray', @count_i OUT, 'users'
    WHILE @i < @count_i
      BEGIN
        EXEC sp_OASetProperty @jResp, 'I', @i
        EXEC sp_OAMethod @jResp, 'IntOf', @anim40 OUT, 'users[i].anim40'
        EXEC sp_OAMethod @jResp, 'StringOf', @quisa9 OUT, 'users[i].quisa9'
        EXEC sp_OAMethod @jResp, 'BoolOf', @fugiat_e OUT, 'users[i].fugiat_e'
        EXEC sp_OAMethod @jResp, 'StringOf', @non_224 OUT, 'users[i].non_224'
        EXEC sp_OAMethod @jResp, 'StringOf', @cillumeb OUT, 'users[i].cillumeb'
        SELECT @i = @i + 1
      END

    EXEC @hr = sp_OADestroy @http
    EXEC @hr = sp_OADestroy @queryParams
    EXEC @hr = sp_OADestroy @sbResponseBody
    EXEC @hr = sp_OADestroy @jResp


END
GO

Curl Command

curl  -u login:password -G -d "since=%3Cstring%3E"
	-H "Accept: application/json"
https://example.zendesk.com/api/v2/activities

Postman Collection Item JSON

{
  "name": "List Activities",
  "request": {
    "method": "GET",
    "header": [
      {
        "key": "Accept",
        "value": "application/json"
      }
    ],
    "url": {
      "raw": "{{baseUrl}}/api/v2/activities?since=<string>",
      "host": [
        "{{baseUrl}}"
      ],
      "path": [
        "api",
        "v2",
        "activities"
      ],
      "query": [
        {
          "key": "since",
          "value": "<string>",
          "description": "A UTC time in ISO 8601 format to return ticket activities since said date."
        }
      ]
    },
    "description": "Lists ticket activities in the last 30 days affecting the agent making the request.\nAlso sideloads the following arrays of user records:\n\n- actors - All actors involved in the listed activities\n- users - All users involved in the listed activities\n\n#### Pagination\n\n- Cursor pagination (recommended)\n- Offset pagination\n\nSee [Pagination](/api-reference/introduction/pagination/).\n\nReturns a maximum of 100 records per page.\n\n#### Allowed For\n\n* Agents\n"
  },
  "response": [
    {
      "name": "Success response",
      "originalRequest": {
        "method": "GET",
        "header": [
          {
            "description": "Added as a part of security scheme: basic",
            "key": "Authorization",
            "value": "Basic <credentials>"
          }
        ],
        "url": {
          "raw": "{{baseUrl}}/api/v2/activities?since=<string>",
          "host": [
            "{{baseUrl}}"
          ],
          "path": [
            "api",
            "v2",
            "activities"
          ],
          "query": [
            {
              "key": "since",
              "value": "<string>",
              "description": "A UTC time in ISO 8601 format to return ticket activities since said date."
            }
          ]
        }
      },
      "status": "OK",
      "code": 200,
      "_postman_previewlanguage": "json",
      "header": [
        {
          "key": "Content-Type",
          "value": "application/json"
        }
      ],
      "cookie": [
      ],
      "body": "{\n  \"activities\": [\n    {\n      \"actor\": {\n        \"name\": \"<string>\",\n        \"active\": \"<boolean>\",\n        \"alias\": \"<string>\",\n        \"chat_only\": \"<boolean>\",\n        \"created_at\": \"<string>\",\n        \"custom_role_id\": \"<integer>\",\n        \"default_group_id\": \"<integer>\",\n        \"details\": \"<string>\",\n        \"email\": \"<string>\",\n        \"external_id\": \"<string>\",\n        \"iana_time_zone\": \"<string>\",\n        \"id\": \"<integer>\",\n        \"last_login_at\": \"<string>\",\n        \"locale\": \"<string>\",\n        \"locale_id\": \"<integer>\",\n        \"moderator\": \"<boolean>\",\n        \"notes\": \"<string>\",\n        \"only_private_comments\": \"<boolean>\",\n        \"organization_id\": \"<integer>\",\n        \"phone\": \"<string>\",\n        \"photo\": {\n          \"adipisicing7\": 56151302,\n          \"irure_70\": true\n        },\n        \"remote_photo_url\": \"<string>\",\n        \"report_csv\": \"<boolean>\",\n        \"restricted_agent\": \"<boolean>\",\n        \"role\": \"<string>\",\n        \"role_type\": \"<integer>\",\n        \"shared\": \"<boolean>\",\n        \"shared_agent\": \"<boolean>\",\n        \"shared_phone_number\": \"<boolean>\",\n        \"signature\": \"<string>\",\n        \"suspended\": \"<boolean>\",\n        \"tags\": \"<array>\",\n        \"ticket_restriction\": \"<string>\",\n        \"time_zone\": \"<string>\",\n        \"two_factor_auth_enabled\": \"<boolean>\",\n        \"updated_at\": \"<string>\",\n        \"url\": \"<string>\",\n        \"user_fields\": {\n          \"tempor_f\": 85786252.44695336\n        },\n        \"verified\": \"<boolean>\"\n      },\n      \"actor_id\": \"<integer>\",\n      \"created_at\": \"<string>\",\n      \"id\": \"<integer>\",\n      \"object\": {\n        \"officia1a2\": true,\n        \"qui9\": \"voluptate mollit Excepteur ipsum veniam\",\n        \"irure_1cd\": \"id ea\"\n      },\n      \"target\": {\n        \"sede8\": false\n      },\n      \"title\": \"<string>\",\n      \"updated_at\": \"<string>\",\n      \"url\": \"<string>\",\n      \"user\": {\n        \"name\": \"<string>\",\n        \"active\": \"<boolean>\",\n        \"alias\": \"<string>\",\n        \"chat_only\": \"<boolean>\",\n        \"created_at\": \"<string>\",\n        \"custom_role_id\": \"<integer>\",\n        \"default_group_id\": \"<integer>\",\n        \"details\": \"<string>\",\n        \"email\": \"<string>\",\n        \"external_id\": \"<string>\",\n        \"iana_time_zone\": \"<string>\",\n        \"id\": \"<integer>\",\n        \"last_login_at\": \"<string>\",\n        \"locale\": \"<string>\",\n        \"locale_id\": \"<integer>\",\n        \"moderator\": \"<boolean>\",\n        \"notes\": \"<string>\",\n        \"only_private_comments\": \"<boolean>\",\n        \"organization_id\": \"<integer>\",\n        \"phone\": \"<string>\",\n        \"photo\": {\n          \"Ut975\": -74534220.66145113,\n          \"magna3e\": false\n        },\n        \"remote_photo_url\": \"<string>\",\n        \"report_csv\": \"<boolean>\",\n        \"restricted_agent\": \"<boolean>\",\n        \"role\": \"<string>\",\n        \"role_type\": \"<integer>\",\n        \"shared\": \"<boolean>\",\n        \"shared_agent\": \"<boolean>\",\n        \"shared_phone_number\": \"<boolean>\",\n        \"signature\": \"<string>\",\n        \"suspended\": \"<boolean>\",\n        \"tags\": \"<array>\",\n        \"ticket_restriction\": \"<string>\",\n        \"time_zone\": \"<string>\",\n        \"two_factor_auth_enabled\": \"<boolean>\",\n        \"updated_at\": \"<string>\",\n        \"url\": \"<string>\",\n        \"user_fields\": {\n          \"ut_d\": \"tempor\",\n          \"adipisicing_7\": 28937910,\n          \"magna_9\": -45754090.269199036\n        },\n        \"verified\": \"<boolean>\"\n      },\n      \"user_id\": \"<integer>\",\n      \"verb\": \"<string>\"\n    },\n    {\n      \"actor\": {\n        \"name\": \"<string>\",\n        \"active\": \"<boolean>\",\n        \"alias\": \"<string>\",\n        \"chat_only\": \"<boolean>\",\n        \"created_at\": \"<string>\",\n        \"custom_role_id\": \"<integer>\",\n        \"default_group_id\": \"<integer>\",\n        \"details\": \"<string>\",\n        \"email\": \"<string>\",\n        \"external_id\": \"<string>\",\n        \"iana_time_zone\": \"<string>\",\n        \"id\": \"<integer>\",\n        \"last_login_at\": \"<string>\",\n        \"locale\": \"<string>\",\n        \"locale_id\": \"<integer>\",\n        \"moderator\": \"<boolean>\",\n        \"notes\": \"<string>\",\n        \"only_private_comments\": \"<boolean>\",\n        \"organization_id\": \"<integer>\",\n        \"phone\": \"<string>\",\n        \"photo\": {\n          \"aliquipb6\": false\n        },\n        \"remote_photo_url\": \"<string>\",\n        \"report_csv\": \"<boolean>\",\n        \"restricted_agent\": \"<boolean>\",\n        \"role\": \"<string>\",\n        \"role_type\": \"<integer>\",\n        \"shared\": \"<boolean>\",\n        \"shared_agent\": \"<boolean>\",\n        \"shared_phone_number\": \"<boolean>\",\n        \"signature\": \"<string>\",\n        \"suspended\": \"<boolean>\",\n        \"tags\": \"<array>\",\n        \"ticket_restriction\": \"<string>\",\n        \"time_zone\": \"<string>\",\n        \"two_factor_auth_enabled\": \"<boolean>\",\n        \"updated_at\": \"<string>\",\n        \"url\": \"<string>\",\n        \"user_fields\": {\n          \"euc13\": \"pariatur\"\n        },\n        \"verified\": \"<boolean>\"\n      },\n      \"actor_id\": \"<integer>\",\n      \"created_at\": \"<string>\",\n      \"id\": \"<integer>\",\n      \"object\": {\n        \"pariatur_39\": -13246316,\n        \"voluptate_8\": false,\n        \"ipsum4\": -24640571\n      },\n      \"target\": {\n        \"est_d\": 43464084.60404679\n      },\n      \"title\": \"<string>\",\n      \"updated_at\": \"<string>\",\n      \"url\": \"<string>\",\n      \"user\": {\n        \"name\": \"<string>\",\n        \"active\": \"<boolean>\",\n        \"alias\": \"<string>\",\n        \"chat_only\": \"<boolean>\",\n        \"created_at\": \"<string>\",\n        \"custom_role_id\": \"<integer>\",\n        \"default_group_id\": \"<integer>\",\n        \"details\": \"<string>\",\n        \"email\": \"<string>\",\n        \"external_id\": \"<string>\",\n        \"iana_time_zone\": \"<string>\",\n        \"id\": \"<integer>\",\n        \"last_login_at\": \"<string>\",\n        \"locale\": \"<string>\",\n        \"locale_id\": \"<integer>\",\n        \"moderator\": \"<boolean>\",\n        \"notes\": \"<string>\",\n        \"only_private_comments\": \"<boolean>\",\n        \"organization_id\": \"<integer>\",\n        \"phone\": \"<string>\",\n        \"photo\": {\n          \"esse_b\": \"occaec\",\n          \"ut_e6f\": \"Ut est deserunt\"\n        },\n        \"remote_photo_url\": \"<string>\",\n        \"report_csv\": \"<boolean>\",\n        \"restricted_agent\": \"<boolean>\",\n        \"role\": \"<string>\",\n        \"role_type\": \"<integer>\",\n        \"shared\": \"<boolean>\",\n        \"shared_agent\": \"<boolean>\",\n        \"shared_phone_number\": \"<boolean>\",\n        \"signature\": \"<string>\",\n        \"suspended\": \"<boolean>\",\n        \"tags\": \"<array>\",\n        \"ticket_restriction\": \"<string>\",\n        \"time_zone\": \"<string>\",\n        \"two_factor_auth_enabled\": \"<boolean>\",\n        \"updated_at\": \"<string>\",\n        \"url\": \"<string>\",\n        \"user_fields\": {\n          \"voluptatef\": -38514506.191917874,\n          \"utba9\": -99737083,\n          \"ut_2\": false\n        },\n        \"verified\": \"<boolean>\"\n      },\n      \"user_id\": \"<integer>\",\n      \"verb\": \"<string>\"\n    }\n  ],\n  \"actors\": [\n    {\n      \"Excepteur1_\": -85145004.89320306,\n      \"consectetura8a\": -98072772.2193171,\n      \"id_e\": -68362078.49006462,\n      \"reprehenderit_93\": 96874887,\n      \"elit7\": \"dolor\"\n    },\n    {\n      \"ad_1a\": \"sunt nulla incididunt sed\"\n    }\n  ],\n  \"count\": \"<integer>\",\n  \"next_page\": \"<string>\",\n  \"previous_page\": \"<string>\",\n  \"users\": [\n    {\n      \"anim40\": -83874192,\n      \"quisa9\": 17607150.376219943,\n      \"fugiat_e\": true,\n      \"non_224\": 21739369.8385354\n    },\n    {\n      \"cillumeb\": \"ut nisi sunt deserunt\"\n    }\n  ]\n}"
    }
  ]
}