### Recommendation Details API Response Example Source: https://www.credly.com/docs/recommendations This is an example of a successful response (200 OK) for a single recommendation. It provides comprehensive details about the recommendation, including its ID, title, type, and associated badge template information. ```JSON { "data": { "id": "331f40b1-71f8-403a-994e-800dbbf76840", "title": "My First Badge", "type": "badge", "activity_url": "", "recommended_badge_template_id": "bd48639a-107c-4074-9364-a559af62f0ce", "url": "/org/acclaim/badge/my-first-badge", "issuer_name": "Acclaim", "image_url": null, "issuer_icon": null, "description": "Dynamically deliver go forward e-tailers", "badge_template_ids": [ "cdc0a99b-d4c3-4ecc-a4f1-b4968edb5b0d" ] }, "metadata": { } } ``` -------------------------------- ### Issuing a Badge Example Source: https://www.credly.com/docs/authorization_tokens An example using curl to demonstrate how to issue a badge using an authorization token for authentication. ```APIDOC ## Issuing a Badge via API (Example) ### Description This example demonstrates how to issue a badge using the Credly API with HTTP Basic Authentication, where the `authorization_token` is used as the username and the password is blank. This is a common pattern for authenticating with the Credly API. ### Method POST ### Endpoint `https://api.credly.com/v1/organizations//badges` ### Parameters #### Path Parameters - **organization_id** (string) - Required - The ID of the organization to which the badge will be issued. #### Query Parameters None #### Request Body - **badge_template_id** (string) - Required - The ID of the badge template to use. - **issued_at** (string) - Required - The timestamp when the badge was issued. - **issued_to_first_name** (string) - Required - The first name of the recipient. - **issued_to_last_name** (string) - Required - The last name of the recipient. - **recipient_email** (string) - Required - The email address of the recipient. ### Request Example ```bash curl -u 'HTdauSjqXyes5LbxLO5GZw':'' \ -X POST -H "Content-type: application/json" \ -d '{ "badge_template_id":"13034728-bb90-473b-ba8a-97b4fab04420", "issued_at":"2019-03-22T00:00:00-04:00", "issued_to_first_name":"test", "issued_to_last_name":"bunny", "recipient_email":"user@example.com"}' \ https://api.credly.com/v1/organizations/08bcedcd-3f67-40e9-b857-1ed8e0a80d6d/badges ``` ### Response #### Success Response (200) (Response details for issuing a badge are not provided in the input text, but would typically include confirmation of the badge issuance.) #### Response Example (No specific response example provided in the input text.) ``` -------------------------------- ### List Recommendations API Response Example Source: https://www.credly.com/docs/recommendations This is an example of a successful response (200 OK) when listing recommendations. It includes a 'data' array containing individual recommendation objects and a 'metadata' object detailing pagination information. ```JSON { "data": [ { "id": "941e9d86-43fe-4f18-b463-e42d1bca719c", "title": "Another Badge", "type": "badge", "recommended_badge_template_id": "cf9bdf2c-ffcc-4de1-9f35-8be3871410b6", "updated_at": "2019-06-26T07:27:53.629Z", "badge_templates_count": 0 }, { "id": "4b8b2c97-b61b-4db1-8a65-8f176d080a1e", "title": "My First Badge", "type": "badge", "recommended_badge_template_id": "44833497-e12a-44e0-9675-dd4cce8052c4", "updated_at": "2019-06-26T07:27:53.614Z", "badge_templates_count": 1 }, { "id": "192e74d7-f002-4ec8-9111-a920e57fe9c3", "title": "Recommendation Title", "type": "information", "activity_url": "http://www.lolcats.com", "updated_at": "2019-06-26T07:27:53.633Z", "badge_templates_count": 0 } ], "metadata": { "count": 3, "current_page": 1, "total_count": 3, "total_pages": 1, "per": 50, "previous_page_url": null, "next_page_url": null } } ``` -------------------------------- ### Create Authorization Token (Example Request Body) Source: https://www.credly.com/docs/authorization_tokens An example JSON payload for creating an authorization token. Optional keys include 'description', 'read_enabled', 'write_enabled', and 'delete_enabled'. ```json { "description": "Token used for external integrations", "read_enabled": true, "write_enabled": true, "delete_enabled": false } ``` -------------------------------- ### Get Single Employee - Response Example (200 OK) Source: https://www.credly.com/docs/workforce Example JSON response for a successful request to retrieve a single employee's data. Includes employee details like ID, email, name, team, and organizational information. ```json { "data": { "id": "89e5edda-1b2c-4e1f-b5b7-38eb4a7884b5", "email": "email4@example.com", "created_at": "2014-04-01T14:41:00.000Z", "employee_state": "pending", "employee_state_updated_at": "2014-04-01T14:41:00.000Z", "last_invitation_sent_at": null, "first_name": "John", "last_name": "Doe", "full_name": "John Doe", "photo_url": null, "team": "Development", "external_id": null, "position_title": "Front End", "manager_first_name": null, "manager_last_name": null, "manager_external_id": null, "location": null, "country": null, "zip_code": null, "state_or_province": null, "department": "Engineering", "organization_level_1": "Farming", "organization_level_2": "Aquatic", "organization_level_3": "Kelp", "job_family": "f100" }, "metadata": { } } ``` -------------------------------- ### Example JSON Response for Badges Source: https://www.credly.com/docs/issued_badges This is an example of a successful JSON response (200 OK) when fetching badge data. It includes details about the user, the issuer, and the badge template, structured in a nested format. ```json { "data": [ { "user": { "id": "779c8150-3020-4799-8f4d-0b306885ea9a", "email": "779c8150-3020-4799-8f4d-0b306885ea9a@example.com", "first_name": "Alfred", "middle_name": "Beaker", "last_name": "Skiles", "current_position_name": "*****", "current_organization_name": "*****", "confirmed": true, "photo": null, "photo_url": null, "url": "https://www.credly.com/users/alfred-beaker-skiles.8b4522fc" }, "created_by": { "type": "Organization", "id": "6c816b4b-ee8b-4f47-8468-2e8ce0ced20c", "name": "Organization 273", "url": "https://api.credly.com/v1/organizations/6c816b4b-ee8b-4f47-8468-2e8ce0ced20c", "vanity_url": "https://www.credly.com/org/organization-273", "internationalize_badge_templates": false, "share_to_ziprecruiter": true, "twitter_url": "https://twitter.com/example", "verified": true }, "issuer": { "summary": "issued by Organization 273", "entities": [ { "label": "Issued by", "primary": true, "entity": { "type": "Organization", "id": "6c816b4b-ee8b-4f47-8468-2e8ce0ced20c", "name": "Organization 273", "url": "https://api.credly.com/v1/organizations/6c816b4b-ee8b-4f47-8468-2e8ce0ced20c", "vanity_url": "https://www.credly.com/org/organization-273", "internationalize_badge_templates": false, "share_to_ziprecruiter": true, "twitter_url": "https://twitter.com/example", "verified": true } } ] }, "printing_enabled": false, "print_method": null, "badge_template": { "primary_badge_template_id": null, "variant_name": null, "id": "7d47e38d-76d4-4749-b3eb-0b7395016474", "allow_duplicate_badges": true, "description": "Dynamically deliver go forward e-tailers" } } ] } ``` -------------------------------- ### Employee Skills API Request Example Source: https://www.credly.com/docs/workforce This snippet demonstrates the structure of a GET request to the Employee Skills API, including the base URL and the format for URL parameters used for filtering. ```http GET /organizations//employee_skills ``` -------------------------------- ### Get Grantors (API Response Example) Source: https://www.credly.com/docs/issuer_authorizations An example JSON response for the 'Get Grantors' API call, illustrating the structure of data returned, including grantor organization details. ```json { "data": [ { "id": "bf4aec8c-a5cd-4ed9-bcb1-75e3222ecb5d", "grantor": { "type": "Organization", "id": "e43cb779-9858-407b-a22d-6cd8abe893bd", "name": "Organization 35", "vanity_slug": "organization-35", "url": "http://www.example.com/", "photo": { "id": "24ead5f0-6209-4921-a6a2-95e5716467ca", "url": "/system/test/images/24ead5f0-6209-4921-a6a2-95e5716467ca/large_fake-600x600.png" }, "photo_url": "https://cdn.example.com/path/to/image.png", "badge_template_count": 0 } } ], "metadata": { "count": 1, "current_page": 1, "total_count": 1, "total_pages": 1, "per": 50, "previous_page_url": null, "next_page_url": null } } ``` -------------------------------- ### Initialize Pendo for Product Analytics Source: https://www.credly.com/docs/recommendations Initializes Pendo, a product analytics tool, for user behavior tracking and in-app guidance. It loads the Pendo agent script with a unique API key. ```javascript (function(apiKey){ (function(p,e,n,d,o){var v,w,x,y,z;o=p[d]=p[d]||{};o._q=[]; v=['initialize','identify','updateOptions','pageLoad'];for(w=0,x=v.length;w < x;++w)(function(m){o[m]=o[m]||function(){o._q[m===v[0]?'unshift':'push']([m].concat([].slice.call(arguments,0)));};})(v[w]); y=e.createElement(n);y.async=!0;y.src='https://cdn.pendo.io/agent/static/'+apiKey+'/pendo.js'; z=e.getElementsByTagName(n)[0];z.parentNode.insertBefore(y,z);})(window,document,'script','pendo'); })("65460ef3-56d0-45a3-7b3b-fe1ec0463054") ``` -------------------------------- ### Get Issuers (API Response Example) Source: https://www.credly.com/docs/issuer_authorizations Provides an example JSON response for the 'Get Issuers' API request, detailing the structure of issuer data including IDs, authorization types, and associated organization details. ```json { "data": [ { "id": "7afe939e-b907-4234-90dd-a71f60bb1be6", "authorization_type": "platform", "display_issuer_as": "grantor", "restrict_by_badge_templates": false, "subscription_type": null, "allowed_badge_templates": [ ], "collections": [ ], "issuer": { "type": "Organization", "id": "4a98b6d0-17c2-41c6-b452-343f447fe31a", "name": "Organization 34", "vanity_slug": "organization-34", "url": "http://www.example.com/", "photo": { "id": "7c5e4b37-12ea-425c-b376-d26ef6676b25", "url": "https://cdn.example.com/path/to/image.png" }, "photo_url": "https://cdn.example.com/path/to/image.png", "badge_template_count": 0 }, "grantor": { "type": "Organization", "id": "9caffc27-6f59-4beb-ac27-aee61804ca2b", "name": "Organization 33", "vanity_slug": "organization-33", "url": "http://www.example.com/", "photo": { "id": "8d1c55df-6ced-450d-a386-7d9628f95f63", "url": "/system/test/images/8d1c55df-6ced-450d-a386-7d9628f95f63/large_fake-600x600.png" }, "photo_url": "https://cdn.example.com/path/to/image.png", "badge_template_count": 0 } } ], "metadata": { "count": 1, "current_page": 1, "total_count": 1, "total_pages": 1, "per": 50, "previous_page_url": null, "next_page_url": null } } ``` -------------------------------- ### Initialize Pendo for Product Analytics Source: https://www.credly.com/docs/webhooks Initializes the Pendo SDK for product analytics and user behavior tracking. It dynamically loads the Pendo JavaScript agent with a provided API key. ```javascript // ``` -------------------------------- ### Employee External Badges API Request Example Source: https://www.credly.com/docs/workforce Example of a GET request to the Employee External Badges API to retrieve badges for a specific organization. ```http GET /organizations//employee_external_badges ``` -------------------------------- ### Get an Organization - API Response Example Source: https://www.credly.com/docs/organizations An example JSON response for the 'Get an Organization' API request. It includes a 'data' object containing detailed attributes of a single organization, such as ID, name, contact information, and URLs. This response is returned upon successful retrieval of an organization's data. ```json { "data": { "id": "eb0600c0-c1f6-444c-9764-5c90d3dbb878", "name": "Organization 9", "website_url": "http://www.example.com/", "webhook_url": "https://example.com/webhook.asp", "contact_email": "hello9@example.com", "legal_contact_email": "legal9@example.com", "technical_contact_email": "person9@example.com", "zip_or_postal_code": "55437", "organization_type": "Dynamic Markets Engineering", "bio": "Function-based eco-centric standardization gurus", "twitter_url": "https://twitter.com/example", "vanity_slug": "organization-9", "facebook_url": "https://www.facebook.com/example", "linked_in_url": "https://www.linkedin.com/example", "linked_in_name": null, "linked_in_org_id": null, "city": "Bloomington", "address": "1313 Mockingbird Lane", "primary_hex_color": null, "support_email": "someEmail@example.com" } } ``` -------------------------------- ### Initialize Pendo Visitor and Account Data Source: https://www.credly.com/docs/recommendations Initializes the Pendo agent with visitor and account data. This allows Pendo to track user-specific interactions and segment analytics. ```javascript pendo.initialize({"visitor":{},"account":{}}); ``` -------------------------------- ### Initialize Pendo for User Analytics Source: https://www.credly.com/docs/organizations This script initializes the Pendo SDK for product analytics. It requires an API key and can be configured with visitor and account data. ```javascript // ``` -------------------------------- ### Get Employee Data Response with Public Badges (JSON) Source: https://www.credly.com/docs/workforce Example JSON response for retrieving employee data, including personal details and organizational information. This example shows an employee with a 'accepted' state and public badge data. ```json { "data": { "id": "be77d7d8-de09-4d73-8eeb-eb338541a93f", "email": "email312@example.com", "created_at": "2014-04-01T14:41:00.000Z", "employee_state": "accepted", "employee_state_updated_at": "2014-04-01T14:41:00.000Z", "last_invitation_sent_at": null, "first_name": "John", "last_name": "Doe", "full_name": "John Doe", "photo_url": null, "team": null, "external_id": null, "position_title": null, "manager_first_name": null, "manager_last_name": null, "manager_external_id": null, "location": null, "country": null, "zip_code": null, "state_or_province": null, "department": "Engineering", "organization_level_1": "Farming", "organization_level_2": "Aquatic", "organization_level_3": "Kelp", "job_family": "f100", "bio": "Team-oriented leading edge capacity" } } ``` -------------------------------- ### Initialize Pendo SDK for Analytics Source: https://www.credly.com/docs/workforce Initializes the Pendo SDK with provided API key for user behavior tracking and product analytics. It requires the Pendo JavaScript agent to be loaded. ```javascript // ``` -------------------------------- ### Sample Issuer Response (JSON) Source: https://www.credly.com/docs/obi_specified_endpoints A sample JSON response for a successful GET request to retrieve issuer information. It includes details such as the issuer's name, email, description, ID, image URL, and type, conforming to the Open Badges v2 context. ```json { "@context": "https://w3id.org/openbadges/v2", "email": "info@credly.com", "description": "Function-based eco-centric standardization gurus", "id": "https://api.credly.com/v1/obi/v2/issuers/e483968b-1ceb-4434-8258-b4518d078f9d", "image": "https://cdn.example.com/path/to/image.png", "name": "Organization 4", "type": "Issuer", "url": "http://www.example.com/" } ``` -------------------------------- ### Get Employee Data Response (JSON) Source: https://www.credly.com/docs/workforce Example JSON response for retrieving employee data, including personal details, employment state, and organizational information. This data is used to display employee profiles and associated badges. ```json { "data": { "id": "82121bbd-baaf-4018-ba6a-e6847ae30275", "email": "email2@example.com", "created_at": "2014-04-01T14:41:00.000Z", "employee_state": "pending", "employee_state_updated_at": "2014-04-01T14:41:00.000Z", "last_invitation_sent_at": null, "first_name": "Alfred", "last_name": "Skiles", "full_name": "Alfred Skiles", "photo_url": null, "team": "Development", "external_id": "employee-external-id-123", "position_title": "Front End", "manager_first_name": "Jane", "manager_last_name": "Doe", "manager_external_id": "manager-external-id-123", "location": "Minnesota, United States of America", "country": "United States of America", "zip_code": "55347", "state_or_province": "Minnesota", "department": "Engineering", "organization_level_1": "Specialist", "organization_level_2": "Director", "organization_level_3": "Vice President", "job_family": "Human Resources" }, "metadata": { } } ``` -------------------------------- ### Example Response: List of OAuth Applications Source: https://www.credly.com/docs/oauth A sample JSON response for the endpoint retrieving a list of OAuth applications. It includes an array of application objects, each containing details like 'id', 'name', 'description', 'created_at', 'uid', and 'created_by_name'. Metadata about the pagination is also provided. ```json { "data": [ { "id": 42, "name": "My Custom OAuth Application", "description": "This OAuth application is used by our development team to handle our integrations.", "created_at": "2025-04-15T21:21:10.440Z", "updated_at": "2025-04-17T14:18:05.740Z", "last_used_at": null, "last_successfully_used_at": null, "uid": "C-qqxBybJxkrpX5VO5GkDtXbF9wcXZHFS-TfjHvPpP8", "created_by_id": "783148c8-213f-4291-896f-aa9328fc7ee5", "created_by_type": "User", "created_by_name": "John Doe", "creator_available": true, "secret": null }, { "id": 46, "name": "Second OAuth Application", "description": "This application is used by our HR team.", "created_at": "2025-04-17T15:03:59.865Z", "updated_at": "2025-04-17T15:07:42.156Z", "last_used_at": null, "last_successfully_used_at": null, "uid": "BAyJYWZE6zK02WF15QXcmaiwNTkvAIFQlk9X42QbLNw", "created_by_id": "783148c8-213f-4291-896f-aa9328fc7ee5", "created_by_type": "User", "created_by_name": "John Doe", "creator_available": true, "secret": null } ], "metadata": { "count": 2, "current_page": 1, "total_count": 2, "total_pages": 1, "per": 50, "previous_page_url": null, "next_page_url": null } } ``` -------------------------------- ### Get Issued Badges in Bulk (JSON Response Example) Source: https://www.credly.com/docs/issued_badges This JSON object represents a successful response from the high-volume issued badge search endpoint. It includes a list of badges with detailed information, as well as metadata for pagination. The 'default' format provides comprehensive badge and badge template details. ```json { "data": [ { "id": "6b9a5222-489a-468d-8818-be2b23ee9a2e", "issued_to": "Alfred Beaker Skiles", "issued_to_first_name": "Alfred", "issued_to_middle_name": "Beaker", "issued_to_last_name": "Skiles", "issuer_earner_id": null, "locale": "en", "public": true, "recipient_email": "user20001@example.com", "replacement_badge_id": null, "revocation_reason": null, "state": "accepted", "suppress_badge_notification_email": false, "issued_at_date": "2014-04-01", "expires_at_date": "2016-04-01", "badge_url": "https://www.credly.com/badges/9f53aa64-ce37-4dbe-b6bb-b6d0f02c774d", "updated_at": "2014-04-01T14:41:00.000Z", "created_at": "2014-04-01T14:41:00.000Z", "expires_at": "2016-04-01T14:41:00.000Z", "issued_at": "2014-04-01T14:41:00.000Z", "state_updated_at": "2018-01-26T20:39:43.166Z", "badge_template": { "id": "54338420-6837-4757-a771-f239f37c3923", "description": "Dynamically deliver go forward e-tailers", "global_activity_url": "https://example.com/foo", "name": "Badge Template 1", "state": "active", "public": true, "vanity_slug": "badge-template-1", "image": { "id": "56c140da-a7ae-4766-8dd2-b627487b2b3a", "url": "https://cdn.example.com/path/to/image.png" }, "image_url": "https://cdn.example.com/path/to/image.png", "url": "https://www.credly.com/org/organization-1/badge/badge-template-1", "owner": { "type": "Organization", "id": "26d9aced-5233-45ae-96c1-6fdb08692b34" }, "state_updated_at": null, "created_at": "2014-04-01T14:41:00.000Z", "updated_at": "2014-04-01T14:41:00.000Z" }, "created_by": { "type": "Organization", "id": "26d9aced-5233-45ae-96c1-6fdb08692b34" }, "issuer": { "summary": "issued by Organization 1", "entities": [ { "label": "Issued by", "primary": true, "type": "Organization", "id": "296087f5-6820-44c6-93aa-cea556aca312", "name": "Organization 1" } ] }, "user": { "id": "63baa914-0ced-4bb7-b301-a6a1847feed0" } } ], "metadata": { "next_page_url": null } } ``` -------------------------------- ### Initialize Pendo SDK Source: https://www.credly.com/docs/issuer_authorizations Initializes the Pendo SDK for product analytics and user feedback. It requires an API key and can be configured with visitor and account data. This script dynamically loads the Pendo agent. ```javascript var pendoApiKey = "65460ef3-56d0-45a3-7b3b-fe1ec0463054"; window.pendo = { _q: [], initialize: function() { this._q.unshift(['initialize'].concat(Array.prototype.slice.call(arguments, 0))); }, identify: function() { this._q.push(['identify'].concat(Array.prototype.slice.call(arguments, 0))); }, updateOptions: function() { this._q.push(['updateOptions'].concat(Array.prototype.slice.call(arguments, 0))); }, pageLoad: function() { this._q.push(['pageLoad'].concat(Array.prototype.slice.call(arguments, 0))); } }; var script = document.createElement('script'); script.async = true; script.src = 'https://cdn.pendo.io/agent/static/' + pendoApiKey + '/pendo.js'; var firstScript = document.getElementsByTagName('script')[0]; firstScript.parentNode.insertBefore(script, firstScript); pendo.initialize({"visitor":{},"account":{}}); ``` -------------------------------- ### Credly Data Structure Example Source: https://www.credly.com/docs/workforce An example JSON structure representing data related to a Credly badge, including issuer information and badge details. ```json { "vanity_url": "http://localhost:5002/users/acclaim-owner", "badges": [ { "id": "038f24de-6fe9-43de-b213-b36400d18b51", "issued_to": "Alfred Beaker Skiles", "issued_to_first_name": "Alfred", "issued_to_middle_name": "Beaker", "issued_to_last_name": "Skiles", "issued_at": "2014-04-01T14:41:00.000Z", "issued_at_date": "2014-04-01", "expires_at": "2016-04-01T14:41:00.000Z", "expires_at_date": "2016-04-01", "state": "pending", "public": false, "badge_template": { "id": "8b50d7fa-de1a-5073-8110-00ceb18d89dc", "image": null, "image_url": null, "description": "Dynamically deliver go forward e-tailers", "name": "Great GIF Finder", "skills": [ "GIF Finding", "GIF Pronouncing", "GIF Sharing" ] }, "issuer": { "name": "Acclaim", "image_url": null } } ] } ``` -------------------------------- ### Response for Listing Badge Templates Source: https://www.credly.com/docs/recommendations Example JSON response for the 'List Badge Templates' endpoint, showing a successful (200 OK) response with an array of badge template data and metadata. ```JSON { "data": [ { "id": "00bc7d59-4c6a-4765-9414-8d2709760671", "image_url": null, "name": "Another Badge", "public": true, "updated_at": "2019-06-24T18:38:02.583Z", "owner": { "id": "e67ebfdb-e23f-5789-a31d-6c5668bb09b8", "name": "Acclaim" } } ], "metadata": { "count": 1, "current_page": 1, "total_count": 1, "total_pages": 1, "per": 50, "previous_page_url": null, "next_page_url": null } } ``` -------------------------------- ### Request Body for Creating URL Recommendation Source: https://www.credly.com/docs/recommendations Example JSON request body for creating a URL recommendation, specifying the title, description, type, activity URL, and associated badge template IDs. ```JSON { "title": "Go to this URL", "description": "This is a wonderful URL", "type": "information", "activity_url": "http://example.com", "badge_template_ids": [ "c70dbdcc-e0ca-4a29-b510-541e6a539825" ] } ``` -------------------------------- ### Get Grantors (API Request) Source: https://www.credly.com/docs/issuer_authorizations Retrieves a list of organizations that have added a specific organization as an issuer. This uses the GET method to query the grantors endpoint. ```http GET /organizations//grantors ``` -------------------------------- ### Get Badge Class (API Request) Source: https://www.credly.com/docs/obi_specified_endpoints This snippet shows the HTTP GET request to retrieve details about a specific badge class (template) from the Credly API using its ID. This is a standard API call. ```text GET /obi/v2/badge_classes/ ``` -------------------------------- ### Response for Creating Badge Recommendation Source: https://www.credly.com/docs/recommendations Example JSON response for creating a badge recommendation, indicating a '201 Created' status and returning the details of the newly created recommendation. ```JSON { "data": { "id": "30c100f3-2d4a-4108-9619-bf7d3d86ac8b", "title": "My Badge", "type": "badge", "activity_url": "", "recommended_badge_template_id": "8bc4ad34-d05d-4222-8c42-bd035ba12f14", "url": "/org/acclaim/badge/my-badge", "issuer_name": "Acclaim", "image_url": null, "issuer_icon": null, "description": "Dynamically deliver go forward e-tailers", "badge_template_ids": [ "72f0e84a-92a9-45cf-972d-c87183733a17" ] }, "metadata": { } } ``` -------------------------------- ### Get Badge Assertion (API Request) Source: https://www.credly.com/docs/obi_specified_endpoints This snippet shows the HTTP GET request to retrieve a specific badge assertion from the Credly API using its unique ID. It's a direct API call. ```text GET /obi/v2/badge_assertions/ ``` -------------------------------- ### Initialize Cookielaw SDK Source: https://www.credly.com/docs/recommendations Initializes the CookieLaw SDK, essential for managing user consent and privacy compliance on the website. It loads the SDK script from a CDN. ```javascript function OptanonWrapper() { } ``` -------------------------------- ### Get Issuers (API Request) Source: https://www.credly.com/docs/issuer_authorizations Retrieves a list of authorized issuers for a given organization. This API call specifies the GET method and the endpoint for fetching issuer data. ```http GET /organizations//issuers ``` -------------------------------- ### Initialize Google Analytics Source: https://www.credly.com/docs/recommendations Initializes Google Analytics for website traffic analysis. This script sets up the GA object, tracks page views, and requires display features. ```javascript (function(i,s,o,g,r,a,m) { i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)})(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-41547114-1', 'credly.com'); ga('require', 'displayfeatures'); ga('send', 'pageview'); ``` -------------------------------- ### Initialize Pendo Analytics SDK Source: https://www.credly.com/docs/index Initializes the Pendo analytics SDK with the provided API key. This script is responsible for enabling user analytics and product insights within the application. It injects the Pendo JavaScript agent into the DOM. ```javascript (function(apiKey){ (function(p,e,n,d,o){var v,w,x,y,z;o=p[d]=p[d]||{};o._q=[]; v=['initialize','identify','updateOptions','pageLoad'];for(w=0,x=v.length;w < x;++w)(function(m){ o[m]=o[m]||function(){o._q[m===v[0]?'unshift':'push']([m].concat([].slice.call(arguments,0)));}; })(v[w]); y=e.createElement(n);y.async=!0;y.src='https://cdn.pendo.io/agent/static/'+apiKey+'/pendo.js'; z=e.getElementsByTagName(n)[0];z.parentNode.insertBefore(y,z);})(window,document,'script','pendo'); })("65460ef3-56d0-45a3-7b3b-fe1ec0463054") ``` -------------------------------- ### Example Response: Single OAuth Application Source: https://www.credly.com/docs/oauth A sample JSON response for the endpoint retrieving a single OAuth application. It contains detailed information about one specific application, including its 'id', 'name', 'description', 'created_at', 'uid', and creator details. The 'metadata' object is also included, though it may be empty for single resource responses. ```json { "data": { "id": 42, "name": "My Custom OAuth Application", "description": "This OAuth application is used by our development team to handle our integrations.", "created_at": "2025-04-15T21:21:10.440Z", "updated_at": "2025-04-17T14:18:05.740Z", "last_used_at": null, "last_successfully_used_at": null, "uid": "C-qqxBybJxkrpX5VO5GkDtXbF9wcXZHFS-TfjHvPpP8", "created_by_id": "783148c8-213f-4291-896f-aa9328fc7ee5", "created_by_type": "User", "created_by_name": "John Doe", "creator_available": true, "secret": null }, "metadata": { } } ``` -------------------------------- ### Get Single Employee - GET Request Source: https://www.credly.com/docs/workforce Retrieves detailed information for a specific employee within an organization. Requires the organization ID and employee ID (email or external_id). Returns a JSON object containing employee data and metadata. ```http GET /organizations//employees/ ``` -------------------------------- ### Request Body for Creating Badge Recommendation Source: https://www.credly.com/docs/recommendations Example JSON request body for creating a badge recommendation, specifying the type, recommended badge template ID, and associated badge template IDs. ```JSON { "type": "badge", "recommended_badge_template_id": "8bc4ad34-d05d-4222-8c42-bd035ba12f14", "badge_template_ids": [ "72f0e84a-92a9-45cf-972d-c87183733a17" ] } ``` -------------------------------- ### Get Employees API Request Source: https://www.credly.com/docs/workforce This code snippet represents the HTTP GET request to retrieve a list of employees from the organization. It includes query parameters for filtering, sorting, and pagination. The response is a JSON object containing employee data and metadata. ```http GET /organizations//employees ``` -------------------------------- ### Web Service Response Examples Source: https://www.credly.com/docs/index Illustrates typical responses from the Credly API for various HTTP methods and scenarios. It includes success cases (200 OK, 201 Created) and error cases (404 Not Found, 400 Bad Request, 422 Unprocessable Entity). ```json { message: "Resource not found." } ``` ```json { message: "Missing required parameter: email" } ``` ```json { message: "Email address is invalid" } ``` -------------------------------- ### Get Single Badge Template - API Request Source: https://www.credly.com/docs/badge_templates This snippet shows the HTTP GET request to retrieve a specific badge template for an organization. It requires the organization ID and the badge template ID as path parameters. ```http GET /organizations//badge_templates/ ```