The API calls make it possible to

  • check if an access code group exists
  • check if an access code for a user exists in a group
  • add new access code groups
  • generate or add new access codes (optionally linked to a user)
  • delete access codes
  • delete access code groups

Context

There are access code groups in aNewSpring. Access code groups are linked to one or more courses. Access code groups contain access codes.

There are two types of access codes.

  • Regular access codes that learners can use to create an account.
  • Exam access codes that learners use to do an exam (or possibly to fill in an evaluation activity). This is only possible for Test & Assess courses and learners can only use them with a special link (environment URL + /exams).

Exam access codes can be linked to learner accounts beforehand. If this is not done, the user will first have to fill in some details to create an account. After logging in, the activity will open right away.

If the learner has a regular access code, the learner will be able to create an account that will have a subscription to the course(s) that are linked to the access code group.

Support articles:

  • How to create access codes

For historical reasons and to continue to support old API integrations, the terminology of the API and the front-end for administrators does not always match completely. In the API:

  • A subenvironment is called a Reseller.

API calls

You can view more information and an example of each API call in the API Documentation by clicking the titles below. However, all links go to the /apidocs page of a demo environment that you cannot use for your own testing purposes.
To test the API calls, you will need to change the first part of the URL to match the right learning environment.

GET requests

GET /accessCodeGroupExists/{groupID}
Use this to check if an access code group already exists. You will have to use the external ID of the access code group.

Only access code groups that are added with the API can have an external ID. This external ID is not visible in the user interface of aNewSpring.

GET /accessCodeExists/{groupID}/{userID}
Use this to check if there is already an access code for a specific learner in a specific access code group. You will have to use the external IDs of the access code group and user (learner).

Only access code groups that are added with the API can have an external ID. This external ID is not visible in the user interface of aNewSpring.

POST requests

POST /addAccessCodeGroup/{groupID}
Use this to add a new access code group. The access code group will get the external ID that you specify as groupID. The course parameter should have the external IDs of the courses that the access codes in this group give access to, which can be sent as an array by repeating the same parameter with different values.

POST /createAccessCodes/{groupID}
Use this to generate new access codes and add them to a specific access code group. You will need to use the external ID of the access code group.

Only access code groups that are added with the API can have an external ID. This external ID is not visible in the user interface of aNewSpring.

POST /addAccessCodes/{groupID}
Use this to add predefined access codes to a specific access code group. You can send the access codes as an array in the parameter code, by repeating the same parameter with different values.
You will need to use the external ID of the access code group.

Only access code groups that are added with the API can have an external ID. This external ID is not visible in the user interface of aNewSpring.

POST /addAccessCode/{groupID}/{userID}
Use this to add a predefined access code for a specific learner to a specific access code group. This only works for exam access codes. You will need to use the external IDs of the access code group and user (learner).

Only access code groups that are added with the API can have an external ID. This external ID is not visible in the user interface of aNewSpring.

POST /deleteAccessCode/{code}
Use this to delete a specific access code. You don't need any external IDs, but you need to use the access code in this API call.

POST /deleteAccessCodeGroup/{groupID}
Use this to delete a specific access code group. This cannot be undone. You will need to use the external ID of the access code group.

Only access code groups that are added with the API can have an external ID. This external ID is not visible in the user interface of aNewSpring.