Getting API Key

In this example (GitHub - tjvantoll/notecard-ack-example: An example web application showing how to do acknowledgments for Notecard- and Notehub-based projects · GitHub) a Notehub API Key is required. I tried to use this command: curl -X GET -L ‘https://api.notefile.net/v1/projects//devices//public-key’ -H ‘Authorization: Bearer <access_token>’

I have generated a token “api_key_xxxx..” and introduced in <access_token>. However, it doesn’t work. I get this message:

{“err”:“anonymous users cannot use the API. please provide an authentication token”,“code”:401,“status”:“Unauthorized”,“details”:{“transaction_id”:“b7b9604f5e279ac5”}}

Can someone explain how to get an API key then?

Thanks

Hi @carlosG,

The recommended way to create an API key is via Personal Access Tokens. I would follow those guides in order to access the Notehub APIs.

Thanks,
Rob

@carlosG And thanks for pointing this out!

This example predated our introduction of Personal Access Tokens, and I forgot to update the web app. It should be good to go now. Here’s the relevant update: notecard-ack-example/webapp/app/page.tsx at 4af4f61ba34e9c68939c9f7787cbf2ad44c39c97 · tjvantoll/notecard-ack-example · GitHub.

Thanks!

TJ