placeholder

Advice for Operating a Public-Facing API

Advice for Operating a Public-Facing API posted on wednesday, july 12th, 2023 I've been operating Pushover's public-facing API for over a decade now and I thought I'd pass on some advice for those creating a new API. Pushover's API might be unusual in that it is used by a wide range of devices (embe...

Click to view the original at jcs.org

Hasnain says:

Great advice here.

"This took me years to stumble upon, but use a short prefix for each type of random ID you create. Instead of generating an API token of Mk7vuCg9eptiV8qid4mn, make it appMk7vuCg9eptiV8qid4mn. Instead of a user key of zo2iD3x3J9, use userzo2iD3x3J9. Pushover uses a for API tokens, u for user keys, g for group keys, s for subscribed user keys, etc. This makes it easier for users to keep multiple keys/tokens straight when they all look like gibberish and it makes it possible to automate helpful API error responses like "your token parameter has a user key instead of an API token"."

Posted on 2023-07-24T03:21:49+0000