### Example cURL Request for Learning Path Actions Source: https://api.thoughtindustries.com/index This cURL command demonstrates how to make a GET request to the Learning Path Actions endpoint. It includes a placeholder for an API key for authentication and fetches events without specific filters. ```bash curl "https://example.thoughtindustries.com/incoming/v2/events/learningPathAction" -H 'Authorization: Bearer APIKEY' ``` -------------------------------- ### Onboarding Survey Response Example Source: https://api.thoughtindustries.com/index This snippet provides an example of an onboarding survey response structure as returned by an API. It is not a functional endpoint but demonstrates the data format. ```APIDOC ## Onboarding Survey Response Data Structure (Example) ### Description This section illustrates the structure of data returned for an onboarding survey response. It includes details about the survey, company, user, and their answers to the survey questions. ### Response Example ```json { "pageInfo": { "cursor": "MTUxODM2NTg1Mzk5OQ", "hasMore": true }, "events": [ { "companyId": "5fea45fb-d8cb-4f0a-b048-932cc361b20a", "clientId": null, "onboardingSurveyResponse": { "onboardingSurvey": "7b8a1db5-962c-4901-94b8-d4426e7a962b", "company": "5fea45fb-d8cb-4f0a-b048-932cc361b20a", "user": "a2a3b2fb-afd1-4cb8-bf2d-f368515ae88c", "questions": [ { "body": "

What type of smartphone do you use?

", "ref": null, "required": true, "choices": [ { "selected": true, "value": "iPhone" }, { "selected": false, "value": "Samsung" }, { "selected": false, "value": "Android" } ], "openEndedResponse": null, "type": "dropDown" }, { "body": "

Which of the following activities do you use your smartphone for?

", "ref": null, "required": false, "choices": [ { "selected": true, "value": "Phone calls" }, { "selected": false, "value": "Send and receive texts" }, { "selected": false, "value": "Browse Internet" }, { "selected": false, "value": "Check Email " }, { "selected": false, "value": "Social Media" } ], "openEndedResponse": null, "type": "selectBoxes" } ], "updatedAt": "2017-08-28T14:05:32.473Z", "id": "b5f7d580-1c58-452f-9037-845fea36a31a", "createdAt": "2017-08-28T14:05:32.473Z" }, "clientSku": null, "user": "test@thoughtindustries.com", "userDetail": { "firstName": "Test", "lastName": "User", "ref1": null, "ref2": null, "ref3": null, "sfAccountId": null, "externalCustomerId": null, "sfContactId": null, "id": "a2a3b2fb-afd1-4cb8-bf2d-f368515ae88c" }, "event": "onboardingSurveyResponse", "timestamp": "2017-08-28T14:02:00.765Z" } ] } ``` ``` -------------------------------- ### Example API Response - Onboarding Survey Source: https://api.thoughtindustries.com/index This JSON object represents an example response from an API endpoint, detailing an onboarding survey response. It includes user and company identifiers, survey questions with selected choices, and timestamps. ```json { "pageInfo": { "cursor": "MTUxODM2NTg1Mzk5OQ", "hasMore": true }, "events": [ { "companyId": "5fea45fb-d8cb-4f0a-b048-932cc361b20a", "clientId": null, "onboardingSurveyResponse": { "onboardingSurvey": "7b8a1db5-962c-4901-94b8-d4426e7a962b", "company": "5fea45fb-d8cb-4f0a-b048-932cc361b20a", "user": "a2a3b2fb-afd1-4cb8-bf2d-f368515ae88c", "questions": [ { "body": "

What type of smartphone do you use?

", "ref": null, "required": true, "choices": [ { "selected": true, "value": "iPhone" }, { "selected": false, "value": "Samsung" }, { "selected": false, "value": "Android" } ], "openEndedResponse": null, "type": "dropDown" }, { "body": "

Which of the following activities do you use your smartphone for?

", "ref": null, "required": false, "choices": [ { "selected": true, "value": "Phone calls" }, { "selected": false, "value": "Send and receive texts" }, { "selected": false, "value": "Browse Internet" }, { "selected": false, "value": "Check Email " }, { "selected": false, "value": "Social Media" } ], "openEndedResponse": null, "type": "selectBoxes" } ], "updatedAt": "2017-08-28T14:05:32.473Z", "id": "b5f7d580-1c58-452f-9037-845fea36a31a", "createdAt": "2017-08-28T14:05:32.473Z" }, "clientSku": null, "user": "test@thoughtindustries.com", "userDetail": { "firstName": "Test", "lastName": "User", "ref1": null, "ref2": null, "ref3": null, "sfAccountId": null, "externalCustomerId": null, "sfContactId": null, "id": "a2a3b2fb-afd1-4cb8-bf2d-f368515ae88c" }, "event": "onboardingSurveyResponse", "timestamp": "2017-08-28T14:02:00.765Z" } ] } ``` -------------------------------- ### Example Course Completion Response (JSON) Source: https://api.thoughtindustries.com/index An example JSON response from the Course Completions endpoint, detailing a user's course completion. It includes user and course information, along with a timestamp. ```json { "pageInfo": { "cursor": "MTUxODM2NTg1Mzk5OQ", "hasMore": true }, "events": [ { "courseId": "598f6574-eeab-4c0b-bdff-1c8a933c6315", "companyId": "087cc8ea-fc25-40c9-a433-9c64bea3e475", "courseTitle": "Test Course", "user": "test@thoughtindustries.com", "notifiableId": "598f6574-eeab-4c0b-bdff-1c8a933c6315", "userDetail": { "firstName": "Test", "lastName": "User", "email": "test@thoughtindustries.com", "client": "a865e253-ac4b-459a-af27-3aaa46192c7e", "ref1": null, "ref2": null, "ref3": null, "externalCustomerId": null, "id": "76f65d54-6758-4a9a-bb43-f366f8a7f17b" }, "event": "courseCompletion", "timestamp": "2017-05-03T21:16:35.221Z" } ] } ``` -------------------------------- ### Example API Response for Registrations Source: https://api.thoughtindustries.com/index This JSON object showcases an example response from the Registrations API endpoint. It contains pagination details and a list of registration events, including user and company information. ```json { "pageInfo": { "cursor": "MTUxODM2NTg1Mzk5OQ", "hasMore": true }, "events": [ { "timestamp": "2017-06-02T22:06:58.000Z", "user": "test@thoughtindustries.com", "userDetail": { "city": null, "firstName": "Test", "address1": null, "address2": null, "lastName": "User", "telephone": null, "id": "e16501bf-c484-44cb-b1fa-f421bc9d7958", "email": "test@thoughtindustries.com", "sfAccountId": null, "sfContactId": null }, "event": "registration", "companyId": "5fea45fb-d8cb-4f0a-b048-932cc361b20a", "companyHost": null, "companySubdomain": null } ] } ``` -------------------------------- ### Fetch All Clients - Curl Example Source: https://api.thoughtindustries.com/index A `curl` command to fetch a list of all clients from the Panorama API. It includes an example of how to pass an authorization token. This endpoint supports pagination and searching via query parameters. ```bash curl https://example.thoughtindustries.com/incoming/v2/clients -H 'Authorization: Bearer APIKEY' ``` -------------------------------- ### Example API Response - Redemption Code Redemption Source: https://api.thoughtindustries.com/index This JSON object shows an example response for a redeemed code. It includes details about the redemption code, company information, the user who redeemed it, and a timestamp. ```json { "pageInfo": { "cursor": "MTUxODM2NTg1Mzk5OQ", "hasMore": true }, "events": [ { "redemptionCodeGroupLabel": "Test Redemption Code", "companyId": "087cc8ea-fc25-40c9-a433-9c64bea3e475", "companyHost": null, "companySubdomain": null, "redemptionCode": "x4gfza2haz", "timestamp": "2016-12-14T18:40:47.000Z", "user": "test@thoughtindustries.com", "userDetail": { "firstName": "Test", "lastName": "User", "ref1": null, "ref2": null, "ref3": null, "externalCustomerId": null, "id": "bce81b44-34d0-4b4e-aae2-995211f2859c", "sfAccountId": null, "sfContactId": null }, "event": "redemptionCodeRedeem" } ] } ``` -------------------------------- ### Get Course Purchase Events - API Request Example Source: https://api.thoughtindustries.com/index This snippet demonstrates how to make a GET request to the Course Purchases endpoint. It requires an API key for authorization and allows filtering by start and end dates. The response includes pagination information and a list of course purchase events. ```curl curl "https://example.thoughtindustries.com/incoming/v2/events/coursePurchase" -H 'Authorization: Bearer APIKEY' ``` -------------------------------- ### Example cURL Request for Collection Purchases Source: https://api.thoughtindustries.com/index This cURL command demonstrates how to make a GET request to the Collection Purchases endpoint. It requires an authorization token and can optionally filter results by a start and end date. ```curl curl "https://example.thoughtindustries.com/incoming/v2/events/discountGroupPurchase" -H 'Authorization: Bearer APIKEY' ``` -------------------------------- ### Create User - Provision Client and Licenses Source: https://api.thoughtindustries.com/index This cURL command shows how to create a user and simultaneously provision them with a specific client and licenses using the Thought Industries API. The 'clientSku' and 'studentLicenseSkus' parameters are used to define which client and licenses the user should have access to. 'replaceLicenseAccess' controls whether existing licenses should be replaced. ```curl curl -X "POST" "https://example.thoughtindustries.com/incoming/v2/users" \ -H 'Authorization: Bearer APIKEY' \ -H 'Content-Type: application/json' \ -d $'{ "externalCustomerId": "test-123", "upsert": true, "firstName": "Test", "clientSku": "client-test", "email": "test-123@example.org", "replaceLicenseAccess": true, "studentLicenseSkus": [ "main" ], "lastName": "User" }' ``` -------------------------------- ### Get Job Status Example (curl) Source: https://api.thoughtindustries.com/index This example demonstrates how to retrieve the status of a background job using curl. It sends a GET request to a specific job ID endpoint. ```curl curl "https://example.thoughtindustries.com/incoming/v2/jobs/{id}" -H 'Authorization: Bearer APIKEY' ``` -------------------------------- ### Get Meeting Detail API Response Example Source: https://api.thoughtindustries.com/index This is an example JSON response from the Meeting Detail endpoint. It provides comprehensive information about a specific meeting, including its attendees. ```json { "id": "0b8d487e-8c78-4d40-82b0-793895b2404c", "title": "Meeting 1", "course": { "id": "e565b2f3-463-4081-af66-6828e4fe2c70", "title": "Test Course" }, "location": { "id": "56238949-df47-4268-839c-3ee50ab25b61", "name": "Test Location Name" }, "instructors": ["Test Instructor"], "attendeeInfo": "

Benvenuto!

", "startDate": "2020-08-25T16:00:00.000Z", "endDate": "2020-08-25T18:00:00.000Z", "attendees": [ { "id": "ae400d4c-c0fe-4616-a042-10d55737c42a", "email": "test1@thoughtindustries.com", "firstName": "Test", "lastName": "User", "externalCustomerId": "test-user-1" }, { "id": "80727c18-d7b2-40c3-841f-433ad17a0f55", "email": "test2@thoughtindustries.com", "firstName": "Test", "lastName": "User", "externalCustomerId": "test-user-2" }, { "id": "7ef708a8-a298-4b9d-bcef-ba8d386db4c7", "email": "test3@thoughtindustries.com", "firstName": "Test", "lastName": "User", "externalCustomerId": "test-user-3" } ] } ``` -------------------------------- ### GET /incoming/v2/events/quizAttempt Source: https://api.thoughtindustries.com/index The Assessment Attempts endpoint returns information when an assessment is taken. It allows filtering by start and end dates. ```APIDOC ## GET /incoming/v2/events/quizAttempt ### Description Retrieves information about assessment attempts. This endpoint is recommended over the older `quizAttempt` endpoint. Filtering by start and end dates is available. ### Method GET ### Endpoint https://example.thoughtindustries.com/incoming/v2/events/quizAttempt ### Parameters #### Query Parameters - **startDate** (milliseconds unix timestamp) - Optional - Filters the returned results to the specified start date. Defaults to `Tuesday, May 13, 2014 4:53:20 PM`. - **endDate** (milliseconds unix timestamp) - Optional - Filters the returned results to the specified end date. Defaults to the current time. ### Request Example ```bash curl "https://example.thoughtindustries.com/incoming/v2/events/quizAttempt" -H 'Authorization: Bearer APIKEY' ``` ### Response #### Success Response (200) (Response structure for this endpoint is not provided in the input text, but would typically include pagination info and a list of assessment attempt objects.) #### Response Example (No example provided in the input text.) ``` -------------------------------- ### Example User Data Response - JSON Source: https://api.thoughtindustries.com/index This JSON object represents an example response for user data, detailing their allocated learning paths and purchased courses. It includes user identifiers, custom fields, and status information for learning content. ```json { "id": "7d21cc62-df4b-49a9-b24d-d3769b625ca1", "learnerUserId": null, "managerUserId": null, "clientId": null, "sfAccountId": null, "sfContactId": null, "roleKey": "student", "address1": null, "address2": null, "city": null, "state": null, "zipCode": null, "stripeCustomerId": null, "externalCustomerId": "test-123", "shippingName": null, "asset": null, "email": "test-123@example.org", "firstName": "Test", "lastName": "User", "lastActiveAt": null, "ref1": null, "ref2": null, "ref3": null, "ref4": null, "ref5": null, "ref6": null, "ref7": null, "ref8": null, "ref9": null, "ref10": null, "language": null, "customFields": {}, "purchasedBundles": [], "allocatedLicenses": [], "allocatedLearningPaths": [ { "learningPathId": "1a0721ef-a4db-4547-881f-b5aea31ab354", "status": "not-started" } ], "purchasedCourses": [ { "courseId": "22e54b9a-62e0-4f50-9225-c623c7ebe953", "status": "not-started" } ], "balance": null, "preferredCurrency": null } ``` -------------------------------- ### GET /incoming/v2/events/pickableGroupPurchase Source: https://api.thoughtindustries.com/index Retrieves a list of a la carte collection purchases. You can filter the results by providing a start and end date. ```APIDOC ## GET /incoming/v2/events/pickableGroupPurchase ### Description Retrieves a list of a la carte collection purchases. You can filter the results by providing a start and end date. ### Method GET ### Endpoint https://example.thoughtindustries.com/incoming/v2/events/pickableGroupPurchase ### Parameters #### Query Parameters - **startDate** (milliseconds unix timestamp) - Optional - Filters the returned results to the specified start date. Defaults to `Tuesday, May 13, 2014 4:53:20 PM`. - **endDate** (milliseconds unix timestamp) - Optional - Filters the returned results to the specified end date. Defaults to the current time. ### Request Example ```bash curl "https://example.thoughtindustries.com/incoming/v2/events/pickableGroupPurchase" -H "Authorization: Bearer APIKEY" ``` ### Response #### Success Response (200) - **pageInfo** (object) - Information about pagination, including cursor and whether more data is available. - **cursor** (string) - The cursor for the next page of results. - **hasMore** (boolean) - Indicates if there are more results to fetch. - **events** (array) - A list of purchase events. - **id** (string) - Unique identifier for the event. - **transactionId** (string) - Identifier for the transaction. - **giftRecipientEmail** (string) - Email of the gift recipient (if applicable). - **timestamp** (string) - ISO 8601 formatted timestamp of the event. - **companyId** (string) - Identifier for the company. - **coupon** (object) - Details about any applied coupon. - **code** (string) - The coupon code used. - **amountOffInCents** (integer) - The amount discounted in cents. - **couponCode** (string) - The coupon code string. - **priceInCents** (integer) - The total price of the purchase in cents. - **purchasableId** (string) - Identifier for the purchasable item. - **purchasableType** (string) - Type of the purchasable item (e.g., "discountGroup"). - **chargeId** (string) - Identifier for the charge. - **groupId** (string) - Identifier for the group. - **orderId** (string) - Identifier for the order. - **revenueType** (string) - Type of revenue (e.g., "new"). - **quantity** (integer) - The quantity purchased. - **variation** (string) - Variation of the purchasable item (if applicable). - **shippingMethod** (string) - The shipping method used (if applicable). - **type** (string) - The type of event (e.g., "charge"). - **sku** (string) - Stock Keeping Unit. - **slug** (string) - Slug for the collection. - **title** (string) - Title of the collection. - **courseStartDate** (string) - Start date of the course associated with the purchase (if applicable). - **amountNet** (integer) - Net amount of the charge in cents. - **amountWithoutDiscount** (integer) - Amount before any discounts in cents. - **amountDiscounted** (integer) - Amount discounted in cents. - **amountCharged** (integer) - Total amount charged in cents. - **amountRefunded** (integer) - Amount refunded in cents. - **amountDisputed** (integer) - Amount disputed in cents. - **amountTaxed** (integer) - Amount of tax in cents. - **success** (boolean) - Indicates if the transaction was successful. - **failureCode** (string) - Code for transaction failure (if applicable). - **failureMessage** (string) - Message for transaction failure (if applicable). - **user** (string) - Email of the user who made the purchase. - **userDetail** (object) - Details about the user. - **id** (string) - Unique identifier for the user. - **shippingName** (string) - Shipping name of the user. - **address1** (string) - First line of the user's address. - **address2** (string) - Second line of the user's address (if applicable). - **city** (string) - City of the user's address. - **state** (string) - State of the user's address. - **zipCode** (string) - Zip code of the user's address. - **telephone** (string) - Telephone number of the user (if applicable). - **country** (string) - Country of the user's address. - **firstName** (string) - First name of the user. - **lastName** (string) - Last name of the user. - **email** (string) - Email address of the user. - **stripeCustomerId** (string) - Stripe customer ID. - **externalCustomerId** (string) - External customer ID (if applicable). - **sfContactId** (string) - Salesforce Contact ID (if applicable). - **sfAccountId** (string) - Salesforce Account ID (if applicable). - **ref1** to **ref10** (string) - Custom reference fields. - **referral** (object) - Referral information. - **source** (string) - Referral source. - **referrer** (string) - The referrer. - **referrerType** (string) - Type of referrer. #### Response Example ```json { "pageInfo": { "cursor": "MTUxODM2NTg1Mzk5OQ", "hasMore": true }, "events": [ { "id": "087cc8ea-fc25-40c9-a433-9c64bea3e475-1516480087-ch_x45fwds16iI23A1aSGz9egeJ-0", "transactionId": "4925f228-c9c8-5375-95d7-f6c408aa41d9", "giftRecipientEmail": null, "timestamp": "2018-01-20T20:28:07.000Z", "companyId": "087cc8ea-fc25-40c9-a433-9c64bea3e475", "coupon": { "code": null, "amountOffInCents": 0 }, "couponCode": null, "priceInCents": 136740, "purchasableId": "0968fbbe-f066-46d9-b274-b3093bbc34c4", "purchasableType": "discountGroup", "chargeId": "ch_x45fwds16iI23A1aSGz9egeJ-0", "groupId": "ch_x45fwds16iI23A1aSGz9egeJ", "orderId": "b24e4f6b-f1fe-4ec6-80e8-cfb3a92c1f09", "revenueType": "new", "quantity": 1, "variation": null, "shippingMethod": null, "type": "charge", "sku": "2370000377814, 2370000377821", "slug": "test-collection", "title": "Test Collection", "courseStartDate": null, "amountNet": 136740, "amountWithoutDiscount": 136740, "amountDiscounted": 0, "amountCharged": 136740, "amountRefunded": 0, "amountDisputed": 0, "amountTaxed": 7740, "success": true, "failureCode": null, "failureMessage": null, "user": "test@thoughtindustries.com", "userDetail": { "id": "c1eb0b65-68fe-4cf7-8445-6da329d75e48", "shippingName": "Test User", "address1": "123 Test Ave", "address2": null, "city": "Boston", "state": "MA", "zipCode": "02103-3054", "telephone": null, "country": "United States", "firstName": "Test", "lastName": "User", "email": "test@thoughtindustries.com", "stripeCustomerId": "cus_xadhcgrsa3moIR", "externalCustomerId": null, "sfContactId": null, "sfAccountId": null, "ref1": null, "ref2": null, "ref3": null, "ref4": null, "ref5": null, "ref6": null, "ref7": null, "ref8": null, "ref9": null, "ref10": null }, "referral": { "source": null, "referrer": null, "referrerType": null } } ] } ``` ``` -------------------------------- ### Example Course Action Response (JSON) Source: https://api.thoughtindustries.com/index An example JSON response from the Course Actions endpoint, showing an enrollment event. This response structure provides details about the user, course, and the specific action taken, including timestamps. ```json { "pageInfo": { "cursor": "MTUxODM2NTg1Mzk5OQ", "hasMore": true }, "events": [ { "id": "af9d8a5d-366d-4782-9889-51a68307b452", "source": "subscription_access", "timestamp": "2018-02-08T15:31:26.159Z", "type": "enrollment", "user": "test@thoughtindustries.com", "companyId": "66b131f7-33b7-4d5a-b0fa-bed64acd4c4e", "notifiableId": "038f73d7-ab68-4ec8-803d-c7979e9b212f", "courseTitle": "Test Course", "courseSku": null, "userDetail": { "id": "a1c92b59-9360-4206-9fc1-62fb3f75b3be", "shippingName": null, "address1": null, "address2": null, "city": null, "state": null, "zipCode": null, "country": null, "firstName": "Test", "lastName": "User", "email": "test@thoughtindustries.com", "externalCustomerId": null, "sfContactId": null, "sfAccountId": null, "ref1": null, "ref2": null, "ref3": null, "ref4": null, "ref5": null, "ref6": null, "ref7": null, "ref8": null, "ref9": null, "ref10": null } } ] } ``` -------------------------------- ### GET /incoming/v2/events/coursePurchase Source: https://api.thoughtindustries.com/index The Course Purchases endpoint returns information about course purchases. It allows filtering by start and end dates. ```APIDOC ## GET /incoming/v2/events/coursePurchase ### Description Retrieves information about course purchases. This endpoint can be filtered by a specified start and end date. ### Method GET ### Endpoint https://example.thoughtindustries.com/incoming/v2/events/coursePurchase ### Parameters #### Query Parameters - **startDate** (milliseconds unix timestamp) - Optional - Filters the returned results to the specified start date. Defaults to `Tuesday, May 13, 2014 4:53:20 PM`. - **endDate** (milliseconds unix timestamp) - Optional - Filters the returned results to the specified end date. Defaults to the current time. ### Request Example ```bash curl "https://example.thoughtindustries.com/incoming/v2/events/coursePurchase" -H 'Authorization: Bearer APIKEY' ``` ### Response #### Success Response (200) - **pageInfo** (object) - Contains cursor and hasMore information for pagination. - **events** (array) - An array of course purchase objects. - **id** (string) - Unique identifier for the purchase event. - **transactionId** (string) - Identifier for the transaction. - **timestamp** (string) - ISO 8601 timestamp of the purchase. - **companyId** (string) - Identifier for the company. - **priceInCents** (integer) - The purchase price in cents. - **purchasableId** (string) - Identifier for the item purchased (e.g., course). - **purchasableType** (string) - Type of item purchased (e.g., 'course'). - **user** (string) - Email of the user who made the purchase. - **userDetail** (object) - Details about the user. #### Response Example ```json { "pageInfo": { "cursor": "MTUxODM2NTg1Mzk5OQ", "hasMore": true }, "events": [ { "id": "66b131f7-33b7-4d5a-b0fa-bed64acd4c4e-1517868872-ch_x44IEO4smDLAidcy2xz5ZPMg-0", "transactionId": "85457c54-aa9f-5b0d-8fa3-fbd1be40bf2f", "giftRecipientEmail": null, "timestamp": "2018-02-05T22:14:32.000Z", "companyId": "66b131f7-33b7-4d5a-b0fa-bed64acd4c4e", "coupon": { "code": null, "amountOffInCents": 0 }, "couponCode": null, "priceInCents": 2499, "purchasableId": "0076e871-ecbe-480c-a315-d2592359f521", "purchasableType": "course", "chargeId": "ch_x44IEO4smDLAidcy2xz5ZPMg-0", "groupId": "ch_x44IEO4smDLAidcy2xz5ZPMg", "orderId": null, "revenueType": "new", "quantity": 1, "variation": null, "shippingMethod": null, "type": "charge", "sku": null, "slug": "test-course", "title": "Test Course", "courseStartDate": "2017-12-18T18:03:17.073Z", "amountNet": 2499, "amountWithoutDiscount": 2499, "amountDiscounted": 0, "amountCharged": 2499, "amountRefunded": 0, "amountDisputed": 0, "amountTaxed": 0, "success": true, "failureCode": null, "failureMessage": null, "user": "test@thoughtindustries.com", "userDetail": { "id": "1bfaca09-16b3-4f8e-88c3-878e11b0445b", "shippingName": null, "address1": null, "address2": null, "city": null, "state": null, "zipCode": null, "telephone": null, "country": null, "firstName": "Test", "lastName": "User", "email": "test@thoughtindustries.com", "stripeCustomerId": "cus_YYauXzGmWnDqSv", "externalCustomerId": null, "sfContactId": null, "sfAccountId": null, "ref1": null, "ref2": null, "ref3": null, "ref4": null, "ref5": null, "ref6": null, "ref7": null, "ref8": null, "ref9": null, "ref10": null }, "referral": { "source": null, "referrer": null, "referrerType": null } } ] } ``` ``` -------------------------------- ### Get Course View Events - API Request Example Source: https://api.thoughtindustries.com/index This snippet shows how to make a GET request to the Course Views endpoint. Similar to Course Purchases, it requires an API key and supports date filtering. The response structure is also paginated and contains event data. ```curl curl "https://example.thoughtindustries.com/incoming/v2/events/courseView" -H 'Authorization: Bearer APIKEY' ``` -------------------------------- ### Swift: Example API Request (Conceptual) Source: https://api.thoughtindustries.com/index This Swift code snippet demonstrates making an HTTP POST request using `URLSession`. It shows creating the request, setting headers and body, and handling the response data asynchronously. This is a common pattern for network requests in Swift applications. ```swift import Foundation func makeApiRequest() { guard let apiUrl = URL(string: "https://api.thoughtindustries.com/v1/courses/bulk") else { return } let apiToken = "YOUR_API_TOKEN" // Example payload structure (adapt as needed) let payload = ["courseData": [["courseName": "New Course Name", "initialSessionName": "New Session Name"]]] guard let jsonData = try? JSONSerialization.data(withJSONObject: payload, options: []) else { return } var request = URLRequest(url: apiUrl) request.httpMethod = "POST" request.setValue("Bearer \(apiToken)", forHTTPHeaderField: "Authorization") request.setValue("application/json", forHTTPHeaderField: "Content-Type") request.httpBody = jsonData let task = URLSession.shared.dataTask(with: request) { data, response, error in if let error = error { print("Error making API request: \(error.localizedDescription)") return } guard let httpResponse = response as? HTTPURLResponse else { print("Invalid response") return } if (200...299).contains(httpResponse.statusCode) { if let data = data, let responseString = String(data: data, encoding: .utf8) { print("API Response: \(responseString)") } } else { print("API request failed with status code: \(httpResponse.statusCode)") } } task.resume() } ``` -------------------------------- ### Objective-C: Example API Request (Conceptual) Source: https://api.thoughtindustries.com/index This Objective-C code snippet demonstrates making an HTTP POST request using `NSURLSession`. It shows how to set up the request, headers, and body, and handle the response data. This is a foundation for interacting with the Thought Industries API in an iOS or macOS application. ```objective-c #import - (void)makeApiRequest { NSString *apiUrl = @"https://api.thoughtindustries.com/v1/courses/bulk"; NSString *apiToken = @"YOUR_API_TOKEN"; // Example payload structure (adapt as needed) NSDictionary *payloadDict = @{ @"courseData": @[ @{ @"courseName": @"New Course Name", @"initialSessionName": @"New Session Name" } ] }; NSData *jsonData = [NSJSONSerialization dataWithJSONObject:payloadDict options:0 error:nil]; NSString *jsonString = [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding]; NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:apiUrl]]; request.HTTPMethod = @"POST"; [request setValue:[NSString stringWithFormat:@"Bearer %@", apiToken] forHTTPHeaderField:@"Authorization"]; [request setValue:@"application/json" forHTTPHeaderField:@"Content-Type"]; request.HTTPBody = [jsonString dataUsingEncoding:NSUTF8StringEncoding]; NSURLSession *session = [NSURLSession sharedSession]; NSURLSessionDataTask *task = [session dataTaskWithRequest:request completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) { if (error) { NSLog(@"Error making API request: %@", error.localizedDescription); return; } NSHTTPURLResponse *httpResponse = (NSHTTPURLResponse *)response; if (httpResponse.statusCode >= 200 && httpResponse.statusCode < 300) { NSString *responseString = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding]; NSLog(@"API Response: %@", responseString); } else { NSLog(@"API request failed with status code: %ld", (long)httpResponse.statusCode); } }]; [task resume]; } ``` -------------------------------- ### List Meetings API Request Example (cURL) Source: https://api.thoughtindustries.com/index This example demonstrates how to use cURL to make a GET request to the Meetings List API. It includes a placeholder for an API key in the Authorization header. This endpoint retrieves all meetings or meetings for a specific course, supporting cursor-based pagination. ```bash curl "https://example.thoughtindustries.com/incoming/v2/meetings" -H 'Authorization: Bearer APIKEY' ``` -------------------------------- ### Example JSON Response for Learning Path Actions Source: https://api.thoughtindustries.com/index This JSON response illustrates the structure of data returned by the Learning Path Actions endpoint. It contains pagination information and a list of actions, detailing user activity, associated learning paths, and user details. ```json { "pageInfo": { "cursor": "MTUxODM2NTg1Mzk5OQ", "hasMore": true }, "events": [ { "id": "8e5afb8e-281c-467d-b541-d150b61e6934", "source": "learning_path_started", "timestamp": "2020-02-08T17:12:49.303Z", "type": "status_change", "user": "test@thoughtindustries.com", "companyId": "66b131f7-33b7-4d5a-b0fa-bed64acd4c4e", "notifiableId": "038f73d7-ab68-4ec8-803d-c7979e9b212f", "learningPathTitle": "Test Learning Path", "learningPathSku": null, "milestoneTitle": null, "userDetail": { "id": "5f2f3003-248e-44d4-a589-be7e2cb2124b", "shippingName": null, "address1": null, "address2": null, "city": null, "state": null, "zipCode": null, "country": null, "firstName": "Test", "lastName": "User", "email": "test@thoughtindustries.com", "externalCustomerId": null, "sfContactId": null, "sfAccountId": null, "ref1": null, "ref2": null, "ref3": null, "ref4": null, "ref5": null, "ref6": null, "ref7": null, "ref8": null, "ref9": null, "ref10": null } } ] } ```