How to configure ghost admin api with angular or postman

#1

If you’re looking for some help, it’s important to provide as much context as possible so that people are able to assist you. Try to always mention:

  • What’s your URL? This is the easiest way for others to debug your issue
    on a local I am using the ghost local install for test which is running on node version 10.x LTS and on the default ghost port on localhost

  • What version of Ghost are you using?
    the latest one

  • What configuration?
    I was able to generate the api key from backend even I was able to access the content api via postman, I want to access the ghost admin via postman what are the way to do that, as it require token for authentication that’s what I am able to understand.

  • What browser?
    chrome, postman

  • What errors or information do you see in the console?
    Authentication Failed error

Also I am trying to integrate the ghost with my angular web
when I tried to add the client SDK I got the following error

index.js:43 Uncaught ReferenceError: global is not defined
at Object../node_modules/buffer/index.js (index.js:43)
at __webpack_require__ (bootstrap:78)
at Object../node_modules/safe-buffer/index.js (index.js:2)
at __webpack_require__ (bootstrap:78)
at Object../node_modules/jws/lib/sign-stream.js (sign-stream.js:2)
at __webpack_require__ (bootstrap:78)
at Object../node_modules/jws/index.js (index.js:2)
at __webpack_require__ (bootstrap:78)
at Object../node_modules/jsonwebtoken/decode.js (decode.js:1)
at __webpack_require__ (bootstrap:78)

./node_modules/buffer/index.js @ index.js:43
webpack_require @ bootstrap:78
./node_modules/safe-buffer/index.js @ index.js:2
webpack_require @ bootstrap:78
./node_modules/jws/lib/sign-stream.js @ sign-stream.js:2
webpack_require @ bootstrap:78
./node_modules/jws/index.js @ index.js:2
webpack_require @ bootstrap:78
./node_modules/jsonwebtoken/decode.js @ decode.js:1
webpack_require @ bootstrap:78
./node_modules/jsonwebtoken/index.js @ index.js:2
webpack_require @ bootstrap:78
./src/app/app.component.ts @ main.js:127
webpack_require @ bootstrap:78
./src/app/app.module.ts @ app.component.ts:11
webpack_require @ bootstrap:78
./src/main.ts @ main.ts:1
webpack_require @ bootstrap:78
0 @ main.ts:12
webpack_require @ bootstrap:78
checkDeferredModules @ bootstrap:45
webpackJsonpCallback @ bootstrap:32
(anonymous) @ main.js:1

#2

Hey @Vikas_Kandwal :wave:

The admin API is private so you shouldn’t be using a frontend (e.g. angular) to make requests to it. That’s why you’re running into the ReferenceError - the admin sdk is intentionally not compiled to work in the browser.

Have you seen these docs?

Postman supports importing requests from curl, so you can try that to see what you’re missing

#4

If you’re trying to have a custom admin interface, I think your best bet is to use user authentication -

Instead of an integration doing lots of things, it becomes a user doing it

1 Like
closed #6

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.