Requesting User API Key📚 Developer Resources
To get a user API key you can send the user to this page and if they allow access we will send you the API key for the users account created just for your application. ### Making the request ### ---- This part is easy, send the person to this URL structure. You do need to replace ` PUBLISHER ` ` REASON ` and ` SENDBACK ` with your own data in base64 encoding to be url safe for all 3 options listed. You can easily do this in most languages or pre make the URL values using an online encoder like the following. https://www.base64encode.org `` hey.cafe/request/api/PUBLISHER/REASON/SENDBACK `` Data you need to provide PUBLISHER: is your application or website name. REASON: is a simple message that will say why the key is needed like “For our native app”. SENDBACK: is a url to send the user to when done, we do append ` ?key=KEY ` to your URL when sending them back (if already using url variables we change it according), and this will be the API key. ---- ### Checking the access and getting user data ### ---- Now that the user is back on your site you can validate the API key sent back in ` ?key=KEY ` by calling the following URL. If the key is not valid system_api_error will have the value ` notvalid `. `` endpoint.hey.cafe/api/account_key?query=KEY `` ** What to keep and store ** The user can change all details on Hey.Café except the account id. This will always be the same and the value you should store for the linked account along with the API key. Keep in mind each time the user gets sent to the API flow it will change the key so update the key any time the user is sent back to you after validating it's the same user via comparing the stored user id in your system. This key is linked to your ` PROVIDER ` and the ` SENDBACK ` value so make sure you keep this the same each time, otherwise the user will see a buildup of sessions in settings for your service. ----