I got it!
-
Getting access token: the path in the doc is wrong, the right is
/oauth2/access_token
, without v1 or v2.curl --location --request POST 'https://${LMS_HOST}/oauth2/access_token' \ --header 'Content-Type: application/x-www-form-urlencoded' \ --data-urlencode 'grant_type=client_credentials' \ --data-urlencode 'client_id=${CLIENT_ID}' \ --data-urlencode 'client_secret=${CLIENT_SECRET}'
{ "access_token": "xxx-very-secret-access-token-xxx", "expires_in": 36000, "token_type": "Bearer", "scope": "read write email profile" }
-
Getting course blocks: add query param:
requested_fields=other_course_settings
curl --location --request GET 'https://${LMS_HOST}/api/courses/v2/blocks/?course_id=course-v1%3AOrg%2BDO101%2B2022-04&username=admin&requested_fields=other_course_settings' \ --header 'Authorization: Bearer ${ACCESS_TOKEN}'