No response or error when using REST API

I’m attempting to use the Atlassian REST API for the first time using the instructions at https://developer.atlassian.com/cloud/confluence/using-the-rest-api/

If I leave off the authorization header I receive an HTTP 200 and a JSON response indicating no items found (which makes sense because it’s not a public Confluence site, so an unauthenticated user shouldn’t be able to see anything.

If I include the authorization header with my base64 encoded email:token I get absolutely no response. Using the —verbose option on curl I can see that the TCP connection is successful, the TLS is successful, the authorization header is sent correctly, but there is no HTTP response code from the server and no other headers at all from the server. In particular, I’m not seeing a 401 or anything else to indicate that my token is wrong or invalid.

Also, when checking the API Tokens page of my Atlassian account, the Las accessed column for the token I am using shows “Never Accessed”. Is there a way to troubleshoot just the authentication part of the API to see if there’s a permissions problem vs an API syntax problem?

Welcome to the Atlassian developer community @PaulCarver,

The symptoms you describe don’t indicate an auth problem. Can you share your curl command? Maybe turn your API Token into an env var so you don’t leak your secret to everyone. :wink:

Turns out the instructions on that page are wrong, or perhaps merely obsolete. Using:
–user “$EMAIL:$TOKEN”
instead of:
–header “Authorization: Basic $BASE64ENCODEDEMAILCOLONTOKEN”
works just fine.

I don’t know how long curl has had the --user option, but maybe the Atlassian documentation is written for an older version of curl or an older version of Confluence.

@PaulCarver,

Glad you figured it out! In my experience, those examples are dubious and not just for curl. I tend to treat them as psuedocode more than copy/paste. Sorry for the frustration.