cURL Example Code
Here are some code examples using command-line cURL
to access the Axis REST API:
# Request a Bearer Token
#
curl -H "APIKEY: {APIKEY}" https://{SYSTEM-URL}/api.php/token/request/
# Sample API GET
#
curl -H "Authorization: Bearer {TOKEN}" https://{SYSTEM-URL}/api.php/users/list/active/
# Sample API POST
#
curl -X POST -H "Authorization: Bearer {TOKEN}" https:/{SYSTEM-URL}/api.php/courses/enrollments/6/1/ -d "start=20230101&end=20231231"
# Sample API PUT
#
curl -X PUT -H "Authorization: Bearer {TOKEN}" https://{SYSTEM-URL}/api.php/users/1 -d "first_name=Sample&last_name=User"
# Sample API DELETE
#
curl -X DELETE -H "Authorization: Bearer {TOKEN}" https://{SYSTEM-URL}/api.php/courses/enrollments/6/1/