Found this content helpful? Log in or sign up to leave a like!
Error when trying to access canvas namespace through DAP CLI
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I am trying to load two tables from canvas namespace into SSMS through the use of DAP command line interface:
This is the command that I am using:
dap initdb --connection-string "mssql://username:password@princedev.database.windows.net:1433/princedb_qa?driver=ODBC+Driver+18+for+SQL+Server" --namespace canvas --table accounts,users
Which throws the next error:
2025-06-12 09:57:28,344 - ERROR - Error during export: 'https://api-gateway.instructure.com'/ids/auth/login
Full error traceback:
2025-06-12 09:57:22,592 - INFO - Python version: 3.13.3 (tags/v3.13.3:6280bb5, Apr 8 2025, 14:47:33) [MSC v.1943 64 bit (AMD64)]
2025-06-12 09:57:22,593 - INFO - Platform: uname_result(system='Windows', node='AGS-PF2YXBMA', release='10', version='10.0.19045', machine='AMD64')
2025-06-12 09:57:24,469 - INFO - Package versions: {'aiofiles': '24.1.0', 'aiohttp': '3.12.9', 'aiohttp-retry': '2.9.1', 'instructure-dap-client': '1.4.0', 'json_strong_typing': '0.3.9', 'PyJWT': '2.10.1', 'pysqlsync': '0.8.2', 'tsv2py': '0.7.1', 'types-aiofiles': '24.1.0.20250606'}
INFO:pysqlsync.mssql:connecting to dev-admin@princedev.database.windows.net:1433/princedb_qa
INFO:pysqlsync.mssql:('Microsoft SQL Azure (RTM) - 12.0.2000.8 \n\tApr 9 2025 07:13:50 \n\tCopyright (C) 2024 Microsoft Corporation\n',)
2025-06-12 09:57:25,394 - INFO - Database version: Microsoft SQL Azure (RTM) - 12.0.2000.8
Apr 9 2025 07:13:50
Copyright (C) 2024 Microsoft Corporation
INFO:pysqlsync.mssql:connecting to dev-admin@princedev.database.windows.net:1433/princedb_qa
INFO:pysqlsync.mssql:('Microsoft SQL Azure (RTM) - 12.0.2000.8 \n\tApr 9 2025 07:13:50 \n\tCopyright (C) 2024 Microsoft Corporation\n',)
INFO:pysqlsync:explorer: extended column information available
INFO:pysqlsync:explorer: PK/FK information available
2025-06-12 09:57:28,146 - INFO - Starting export of table 'accounts' (1 of 2)
INFO:pysqlsync.mssql:connecting to dev-admin@princedev.database.windows.net:1433/princedb_qa
INFO:pysqlsync.mssql:('Microsoft SQL Azure (RTM) - 12.0.2000.8 \n\tApr 9 2025 07:13:50 \n\tCopyright (C) 2024 Microsoft Corporation\n',)
2025-06-12 09:57:28,344 - ERROR - Error during export: 'https://api-gateway.instructure.com'/ids/auth/login
2025-06-12 09:57:28,345 - ERROR - Failed export of table 'accounts' (1 of 2)
2025-06-12 09:57:28,349 - INFO - Starting export of table 'users' (2 of 2)
INFO:pysqlsync.mssql:connecting to dev-admin@princedev.database.windows.net:1433/princedb_qa
INFO:pysqlsync.mssql:('Microsoft SQL Azure (RTM) - 12.0.2000.8 \n\tApr 9 2025 07:13:50 \n\tCopyright (C) 2024 Microsoft Corporation\n',)
2025-06-12 09:57:28,584 - ERROR - Error during export: 'https://api-gateway.instructure.com'/ids/auth/login
2025-06-12 09:57:28,585 - ERROR - Failed export of table 'users' (2 of 2)
2025-06-12 09:57:28,590 - ERROR - Failed export on 2 tables (0 skipped, 2 failed) of total 2
I don't understand why I am getting this error and how to overcome it, I see that the connection to SSMS is successful, also the credentials created in the identity services are okay, I tested them through Postman and got 200 OK response:
curl --location 'https://api-gateway.instructure.com/ids/auth/login' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'Authorization: Basic dXMtZWFzdC0xI2JlNTQ3M2IyLWI4MjctNDFlOC04YzMyLTFmMWU5MjYzYjJlZDo3SEloUFVXVkt2bFRDcE1GR200c3JjdnBQTGw5Mm4wdThnb2VMdjhWLURj' \
--data-urlencode 'grant_type=client_credentials'
Also I set them as environmental variables in windows command prompt as per the documentation:
set DAP_API_URL=https://api-gateway.instructure.com
set DAP_CLIENT_ID=your_canvas_data_client_id
set DAP_CLIENT_SECRET=your_canvas_data_secret
Do I need any access granted by Canvas Team to be able to initialize the tables from canvas namespace into SSMS?