Award a certificate via API

Certificates can be used to reward learners after they've completed a course or training plan. However, there may be cases where users completed a course or training plan before a certificate was available for the training. In this case, a certificate can be awarded to these users via the Import External Training option in the LMS365 (Learn365) Admin Center or an LMS365 API endpoint. 

In this article, we describe how to award a certificate via the LMS365 API.

 

To award a certificate via the LMS365 API, follow these steps:

1. Navigate to https:/api.365.systems/ and authorize with the relevant API key. For information about the authorization process, see this article.

2. Find the Certificates section, expand it, and find POST method /odata/v2/Certificates with the Create a Certificate description

 

create_a_certificate_via_API_with_no_parameters_set.png

 

3. Select Try it out in the top right-hand corner.

In the Edit Value field, you can see what parameters can be used when creating a certificate:

  • Id, should be deleted because the ID of a certificate will be obtained after it's awarded. 
  • CourseId, a required parameter. Replace guid with the ID of the course that's associated with the certificate.
  • ContentUrl, should be deleted because the URL of a certificate will be generated by LMS365 (Learn365) after it's awarded.
  • IsGenerated, should be deleted because it will be populated by LMS365 (Learn365) after a certificate is generated from the template.
  • Status, an optional parameter. Replace integer with a number to set the certificate status. Valid values are 0 (Valid), 1 (Expiring), or 2 (Expired).
  • Issued, a required parameter. This is automatically populated with the current date and time but it can be changed manually.
  • Expiry, an optional parameter. This is automatically populated with the current date and time but it can be changed manually.
  • TemplateId, an required parameter if you want to generate a PDF file for a certificate, otherwise it can be omitted and only a record will be created for a user. Replace guid with the ID of a certificate template you want to use for the certificate. For information about how to get the ID of a template, see this article.
  • UserId, a required parameter. Replace guid with the ID of the user to whom you want to award the certificate.
  • UserLoginName, an optional parameter. Replace string with the login name of the user. The user's login name can be obtained using the same steps as the UserId described above.

 

Certificate_awarding_via_API_request.png

 

4. When ready, select Execute to run the request. 

5. Go to the Responses block to check the results:

  • Number 2xx (for example, 202) under Code shows that the request worked correctly.
  • In the Response body field, you'll see the awarded certificate with the set parameters. Next to the value parameter, the unique ID of the awarded certificate is displayed. The certificate can also be checked in the user's transcript in the LMS365 (Learn365) Admin Center and in the user's progress.
  • You can use the Download option to save the results to your computer in .JSON format.

 

awarded_certificate_via_aPI_response.png

 

Was this article helpful?
1 out of 1 found this helpful

Comments

Article is closed for comments.