Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

Unable to get token

47 views
Skip to first unread message

RUSS Loski

unread,
Mar 28, 2024, 3:30:30 PM3/28/24
to Beneficiary Claims Data API (BCDA) Community
I am using curl in windows and trying to get a token from the sandbox.  I run the following in my Windows 11 command window:

curl -d '' -X POST 'https://sandbox.bcda.cms.gov/auth/token' --user 3841c594-a8c0-41e5-98cc-38bb45360d3c:efef20edc106b7b355ff09754d5b19014f42820996629a469aa3d4ce1063cbd098b08ccba3bbdcbf -H "accept: application/json"

I get the following error message:

curl: (3) URL rejected: Port number was not a decimal number between 0 and 65535

I am using the following version of curl:

curl 8.4.0 (Windows) libcurl/8.4.0 Schannel WinIDN
Release-Date: 2023-10-11
Protocols: dict file ftp ftps http https imap imaps pop3 pop3s smtp smtps telnet tftp
Features: AsynchDNS HSTS HTTPS-proxy IDN IPv6 Kerberos Largefile NTLM SPNEGO SSL SSPI threadsafe Unicode UnixSockets

Also, I have been trying to run the following:


I get the following error:

curl: (28) Failed to connect to api.bcda.cms.gov port 443 after 42169 ms: Couldn't connect to server

I am new to curl and to this api.

Cheers,

Russ

Beneficiary Claims Data API (BCDA) Community

unread,
Mar 29, 2024, 1:26:47 PM3/29/24
to Beneficiary Claims Data API (BCDA) Community
Hi Russ,

Welcome to the BCDA community! Sorry for the trouble getting up an running with your first Sandbox request using curl. It looks like you're using curl from a Windows machine. If that's the case, you'll need to use double quotes (") in place of single quotes (') in your commands. Please try the following command and let us know the results


curl -d "" -X POST "https://sandbox.bcda.cms.gov/auth/token" --user 3841c594-a8c0-41e5-98cc-38bb45360d3c:efef20edc106b7b355ff09754d5b19014f42820996629a469aa3d4ce1063cbd098b08ccba3bbdcbf -H "accept: application/json"

Regarding the error you've seen requesting the production API (api.bcda.cms.gov): Have you created BCDA credentials and added your IP address yet? You can do this from either https://4innovation.cms.gov/ (for organizations in the ACO REACH and Kidney Care Choice models) or https://acoms.cms.gov/ (for ACOs in the Medicare Shared Savings Program).

Thanks,
The BCDA Team

RUSS Loski

unread,
Mar 29, 2024, 2:13:57 PM3/29/24
to Beneficiary Claims Data API (BCDA) Community
Thank you so much.  Changing the single quotes to double quotes worked.

About using the production API, I don't think that I am eligible for production access.  And it isn't necessary for my purposes.

My ultimate goal with accessing the sandbox is to demonstrate how one can use a couple Microsoft tools to access the BCDA API.  My current audience are people, some of whom work for ACOs, who are learning about Microsoft data tools such as Azure Data Factory, Power BI, etc.  My goal is to encourage people to consider the API as an alternative to downloading the files.

Thank you so much.

RUSS Loski

unread,
Mar 29, 2024, 2:17:56 PM3/29/24
to Beneficiary Claims Data API (BCDA) Community
I tried to access the metadata api from the sandbox.  That worked.


Thanks again.

Reply all
Reply to author
Forward
0 new messages