{"openapi":"3.1.0","paths":{"/api/v2/plugin/oauth2/backend-token":{"post":{"description":"Creates an OAuth access token using the `client_id` and `client_secret` credentials. Once generated, the token authorizes access to the 360Learning API v2 resources for 1 hour. It must be included in the `Authorization` header of each request as `Bearer`.","operationId":"v2.authentication.GeneratePluginBackendTokenController_generatePluginBackendToken","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GeneratePluginBackendTokenBody"}}}},"responses":{"200":{"description":"Returns an access token that must be used in all your calls to public API endpoints. This access token can only be used inside a plugin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateTokenResponse"}}}},"400":{"description":"The server cannot or will not process the request due to something that is perceived to be a client error.","content":{"application/json":{"schema":{"oneOf":[{"title":"invalid request","description":"The given request is malformed. Ensure your payload contains only the expected properties with the correct types.","type":"object","properties":{"error":{"type":"string","enum":["invalid_request"]}},"required":["error"]},{"title":"non existing company","description":"No company can be found for the given `company_id`.","type":"object","properties":{"error":{"type":"string","enum":["non_existing_company"]}},"required":["error"]}]}}}},"401":{"description":"The authorization cannot be granted.","content":{"application/json":{"schema":{"oneOf":[{"title":"incomplete plugin setup","description":"There is no plugin configured for the given company","type":"object","properties":{"error":{"type":"string","enum":["incomplete_plugin_setup"]}},"required":["error"]},{"title":"invalid client","description":"Your credentials pair `client_id`/`client_secret` is invalid.","type":"object","properties":{"error":{"type":"string","enum":["invalid_client"]}},"required":["error"]}]}}}}},"summary":"Create an access token for plugin (backend)","tags":["Authentication"]}},"/api/v2/plugin/oauth2/client-token":{"post":{"description":"Creates an OAuth access token. Once generated, the token authorizes access to the 360Learning API v2 resources for 1 hour. It must be included in the `Authorization` header of each request as `Bearer`.","operationId":"v2.authentication.GeneratePluginClientTokenController_generatePluginClientToken","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GeneratePluginClientTokenBody"}}}},"responses":{"200":{"description":"Returns an access token that must be used in all your calls to public API endpoints. This access token can only be used inside a plugin.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GenerateTokenResponse"}}}},"400":{"description":"The server cannot or will not process the request due to something that is perceived to be a client error.","content":{"application/json":{"schema":{"oneOf":[{"title":"invalid request","description":"The given request is malformed. Ensure your payload contains only the expected properties with the correct types.","type":"object","properties":{"error":{"type":"string","enum":["invalid_request"]}},"required":["error"]},{"title":"invalid token","description":"The given temporary token is either malformed or expired","type":"object","properties":{"error":{"type":"string","enum":["invalid_token"]}},"required":["error"]}]}}}},"401":{"description":"The authorization cannot be granted.","content":{"application/json":{"schema":{"oneOf":[{"title":"incomplete plugin setup","description":"There is no plugin configured for the given token","type":"object","properties":{"error":{"type":"string","enum":["incomplete_plugin_setup"]}},"required":["error"]}]}}}}},"summary":"Create an access token for plugin (client)","tags":["Authentication"]}}},"info":{"title":"Plugin API","description":"","version":"1.0.0","contact":{}},"tags":[],"servers":[{"url":"https://app.360learning.com","description":"Production EU"},{"url":"https://app.us.360learning.com","description":"Production US"}],"components":{"securitySchemes":{"oauth2":{"type":"oauth2","flows":{},"description":"Use the token from the authentication endpoint in the Authorization header.\n\nExample: `Authorization: Bearer <token>`"}},"schemas":{"GeneratePluginBackendTokenBody":{"title":"Generate Plugin Backend Token Body","type":"object","properties":{"client_id":{"type":"string","description":"The client ID associated to the plugin for this environment.","example":"00918d22e6cd4dd0bf751241853ec641"},"client_secret":{"type":"string","description":"The client secret associated to the plugin for this environment.","example":"de831d67bd4245bc950867ca49b5ebc2"},"company_id":{"type":"string","description":"The unique ID of the company.","format":"ObjectId","example":"507f1f77bcf86cd799439011","pattern":"^[a-fA-F0-9]{24}$"},"plugin_id":{"type":"string","description":"The unique ID of the plugin.","format":"ObjectId","example":"507f1f77bcf86cd799439011","pattern":"^[a-fA-F0-9]{24}$"}},"required":["client_id","client_secret","company_id","plugin_id"]},"GenerateTokenResponse":{"title":"Generate Token Response","type":"object","properties":{"token_type":{"type":"string","enum":["Bearer"],"description":"The type of the access token."},"access_token":{"type":"string","description":"The access token that authorizes access to API resources. Include the access token in the `Authorization` header of every request as `Bearer`.","example":"eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJBaU1qdVNjLW9pelVYWHBZVnZWbDZrSklsb2FNWDNWYzZSdWp4QnlPX05FIn0"},"expires_in":{"type":"number","description":"The lifetime of the access token in seconds.","example":"3600"}},"required":["token_type","access_token","expires_in"]},"GeneratePluginClientTokenBody":{"title":"Generate Plugin Client Token Body","type":"object","properties":{"temporaryToken":{"type":"string","description":"The temporary token from an authed user on a core product.","example":"eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJjb21wYW55SWQiOiI1NGJkMDA1MTQyYzM5YWJhMDFmZmQ5OTkiLCJ1c2VySWQiOiI1ODIwNTJkNGU4NTg5ZjBkYTgwY2MyYzciLCJwbHVnaW5JZCI6IjY4NjcwNmQwZjVhOGEwNDFhNzU2MjUyNiIsInR5cGUiOiJwbHVnaW5FeGNoYW5nZSIsImlhdCI6MTc1Mzk1NTkyNSwiZXhwIjoxNzUzOTU1OTg1fQ.roxrGR6Z2utCcVa_vqatYLmMMy82fKcs1KxAdwWJNXuoW7dJTv8ODjZA0FsMI26kRlgTkJl3CDMn6eCqEmrgKw"}},"required":["temporaryToken"]}}},"webhooks":{}}