Enabling Custom Course Settings

I got it!

  1. 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"
    }
    
  2. Enable feature ENABLE_OTHER_COURSE_SETTINGS

  3. Enable COURSE_BLOCKS_API_EXTRA_FIELDS

  4. 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}'
    
1 Like