I am Big Fan of Ghost API
ADD
- Random Posts (with limits)
- Tags
Add Trusted Domain Registration Option on Ghost Admin Panel
I am Big Fan of Ghost API
Add Trusted Domain Registration Option on Ghost Admin Panel
Could you explain what youāre after in a little bit more detail?
I donāt know of any other API that offers random data - itās normal to generate that client side.
Tags are also already offered via the API, so could you explain what you havenāt been able to do?
On the topic of api endpoints, will we be seeing the ability to publish new, edit existing posts via api?
Display Random Posts via API
https://example.com/ghost/api/v0.1/posts/?formats=plaintext&client_id=ghost-frontend&client_secret=xxxxxxxxxxxx&method=random&limit=1
I Build a Quotes website on Ghost
I provide a Public API to My Users (Currently I add CORS Via add_header
Method)
Currently, I need this Below Options
Sorry @mskian I wasnāt asking you to give an example of how it might work. I am saying I do not know of any API of any software or service which offers random data.
We have plans to review API authentication including trusted domains and also writing to the API, but not for a few more months at least. However cc @gcordalis it is currently possible to do anything that Ghost Admin can do via the API, itās just not āofficialā yet and therefore likely to change.
Sorry
the Random Post endpoint for Display the Random Post Results via JSON
Thanks for clarifying - are there any docs about Ghost Admin or should I dig deep and have a look at how it runs?
Best thing to do is open Chrome DevTools whilst using the admin area to do the actions you want to automate, youāll then be able to inspect the API requests in the Network tab.
There are also docs for user authentication that explain how to get the necessary tokens to make private API requests.
If you decide to use the private API just be aware that itās private so that we can change it as needed. Hannah already mentioned above that weāll be looking to overhaul the authentication in the not too distant future, we also want to look at changing how URLs are output so that they are more useful for external clients.
Thanks Kevin and Hannah, this should be everything I need to get started.
Iām not too worried about the Private API changing, this is just a stopgap solution until I have the time to put a proper solution in place.
EDIT:
Hey @Kevin, I know this isnāt supported so understand if you canāt help with this - Iām running into the āUpdateCollisionErrorā - Iām pretty confident the requests Iām making are correct but I canāt seem to get around it. Do you have any suggestions for how to get around this conflict?
That error occurs when the updated_at
value of a post that is sent to the server does not match the updated_at
value that is stored in the database for that post.
You can see the implementation here, the protection is in place to prevent an accidental overwrite of a post with an old version either due to keeping the admin open and using an old tab or when multiple people have edited a post.
Champion, thanks so much!
Tumblr does that. You could go to any Tumblr blog, and open up the /random
endpoint, which will then cause a redirect to a certain post.
Example: http://micro.preslav.me/random
Itās a neat way of allowing people to stumble upon interesting content from the past.
i sugest avoid this approach in favor of etag and conditional request, because its rest complient , flexible and is a protocol already defined.
in this way the knowledge of rest is reuset else need to know a specificity of ghostjs api.