I’ve been trying to use the Ghost Admin API (self-hosted) by two means:
HTTP to the REST api directly
Using the SDK (@tryghost/admin-api)
I’ve created a custom integration, and I’m trying to use the admin api key. I get 403 responses in both cases. Is this supposed to work, or am I missing a key negotiation step (i.e. OAuth or similar)?
For token auth you need to generate JWTs. The @tryghost/admin-api should do that for you though. If you provide the full error response that would be useful as the error message will tell you what’s wrong.
{
“message”: “Request failed with status code 403”,
“name”: “Error”,
“stack”: “Error: Request failed with status code 403\n at createError (/Users/adriaan/clause-blog/process-content/node_modules/axios/lib/core/createError.js:16:15)\n at settle (/Users/adriaan/clause-blog/process-content/node_modules/axios/lib/core/settle.js:17:12)\n at IncomingMessage.handleStreamEnd (/Users/adriaan/clause-blog/process-content/node_modules/axios/lib/adapters/http.js:236:11)\n at IncomingMessage.emit (events.js:203:15)\n at endReadableNT (_stream_readable.js:1129:12)\n at process._tickCallback (internal/process/next_tick.js:63:19)”
}