Add PHP API
-
@julian link in github readme https://community.nodebb.org/api/topic/687/help-translate-nodebb/2 not work
-
@julian Is it possible now with the API to create a category?
-
-
-
Thanks! But i have problems. I not understand how run curl command. Please, tell me how you would use them. Run in linux terminal:
curl -H "Authorization: Bearer {fb66eb42-8206-475e-fsdg-7ddabde551e5}" --data "title={Test post}&content=={Content test post}&cid={1}" http://localhost:4567/api/v1/topics
Output:
Forbidden
-
In top code hidden {2} in value cid. Markdown is hiding.
-
@julian said:
- No curly braces.
- Encode your post body data
curl -H "Authorization: Bearer fb66eb42-8206-475e-fsdg-7ddabde551e5" --data "title=Test%20post&content=Content%20test%20post&cid=1" http://localhost:4567/api/v1/topics
Forbidden
-
I tried user token and master token
-
-
NodeBB output:
2/3 19:20 [32175] - warn: Route requested but not found: /api/v1/topics 2/3 19:20 [32175] - error: /api/v1/topics Error: invalid csrf token at verifytoken (/home/me/www/forums/nodebb/node_modules/csurf/index.js:237:11) at Object.csrf [as applyCSRF] (/home/me/www/forums/nodebb/node_modules/csurf/index.js:100:7) at Object.middleware.buildHeader (/home/me/www/forums/nodebb/src/middleware/middleware.js:191:13) at /home/me/www/forums/nodebb/src/routes/index.js:200:15 at Layer.handle [as handle_request] (/home/me/www/forums/nodebb/node_modules/express/lib/router/layer.js:82:5) at trim_prefix (/home/me/www/forums/nodebb/node_modules/express/lib/router/index.js:302:13) at /home/me/www/forums/nodebb/node_modules/express/lib/router/index.js:270:7 at Function.proto.process_params (/home/me/www/forums/nodebb/node_modules/express/lib/router/index.js:321:12) at next (/home/me/www/forums/nodebb/node_modules/express/lib/router/index.js:261:10) at /home/me/www/forums/nodebb/src/routes/index.js:158:11
-
I got it...
-
I use not standart url - localhost:4567/forum
Url API replace to: localhost:4567/forum/api/v1/...
Copyright © 2024 NodeBB | Contributors