Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Writing prompts: fetch prompt from API by id #71938

Closed
2 tasks
creativecoder opened this issue Jan 11, 2023 · 3 comments · Fixed by Automattic/jetpack#29433
Closed
2 tasks

Writing prompts: fetch prompt from API by id #71938

creativecoder opened this issue Jan 11, 2023 · 3 comments · Fixed by Automattic/jetpack#29433
Assignees

Comments

@creativecoder
Copy link
Contributor

What

Update the blogging-prompts API to retrieve prompts by ID.

Why

With writing prompt notifications, add a query param ?answer_prompt={prompt_id} when starting a new post in the editor to embed that prompt in the post and mark the post as an answer to the prompt.

However, the current prompt API only accepts date based queries, making it difficult to align a specific prompt ID with the results from the API.

How

  • Add an additional endpoint: /sites/{site}/blogging-prompts/{prompt_id} that returns a prompt with that ID.
  • Update Jetpack extension to use new endpoint for fetching (and caching) prompts
@creativecoder
Copy link
Contributor Author

Initial diff for API endpoint at D97676-code.

@creativecoder
Copy link
Contributor Author

And here's the Jetpack PR for the editor extension changes: Automattic/jetpack#28332

@creativecoder
Copy link
Contributor Author

This is addressed in Automattic/jetpack#29433

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment