Skip to content
This repository has been archived by the owner on Sep 22, 2021. It is now read-only.

App endpoint #1106

Open
chevdor opened this issue Feb 24, 2021 · 2 comments
Open

App endpoint #1106

chevdor opened this issue Feb 24, 2021 · 2 comments

Comments

@chevdor
Copy link

chevdor commented Feb 24, 2021

Background

Polkassembly is one of the places of choice to share network relevant discussions and open discussions such as results of running srtool (https://gitlab.com/chevdor/srtool).

As part of a series of improvements for srtool, I would love to simplify the publishing of the results and such an endpoint would be an elegant solution.

Proposal

This proposal consists in a new openly available ingestion endpoint, allowing devs and apps to post to polkassembly directly using its API.

In particular, this could help aggregate data in a single place and prevent the flourishing of unlinked single posts.

Details

I would like to open the discussion here to see how feasable it would be to add such an endpoint.

method: POST
payload:

{
   app: string,
   keys: Record<string, string>,
   data: any
}

Here would be a sample payload:

{
   app: "srtool",
   keys: { commit: "999999999" },
   data: { proposalHash: "0x12345" }
}

Benefit

Instead of having users (and apps) posting in new random discussions, this endpoint would allow creating one single discussion for a given set of keys (as defined in the payload).
It would allow collecting the data from the payload in a single place while allow people to discuss in this single thread.

data could but does not have to be interpreted and could be simply added as attachement into a thread.

@niklabh
Copy link
Contributor

niklabh commented Feb 24, 2021

What is this API doing. Is it creating a new Post for discussion with keys and data?

@chevdor
Copy link
Author

chevdor commented Feb 24, 2021

Yes, it API will either create a new post or append to an existing one.

If the set payload.app + payload.keys is not found, it creates a new post.
If it is present however, it will add the payload.data to the existing post.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants