Skip to content
This repository has been archived by the owner on Aug 7, 2023. It is now read-only.

Suggestion: open the API to create new place #69

Open
PierrePaul opened this issue Apr 16, 2020 · 4 comments
Open

Suggestion: open the API to create new place #69

PierrePaul opened this issue Apr 16, 2020 · 4 comments

Comments

@PierrePaul
Copy link
Contributor

The API is cool. We are thinking about using the API to show specific region (lanaudière, laurentide, etc.).

Some region feels a little empty on solutionlocale.ca for now, so we would like to be able to create new places from the API, sharing the place with everyone instead of storing it on our side.

We can always redirect people to solutionlocale.ca to create their new place, but an API would be nicer.

@jpmurray
Copy link
Collaborator

I actually like, and want this. But I do have a problem with doing it for real, and here's why: all entries submitted to the main website are moderated and either approved or rejected by some of our volounteers... Doesn't the idea of a having an option to write in the API contradicts the "freely create resources" aspect?

I mean, if you submit places wouldn't you expect them to be available now, rather than later in time? Of course, I could have trusted account who can bypass moderation (we've done it with data from UPA, although not from the API), but that would have us vetting accounts into trustability of their entries.

(Now I'm not saying it's a bad idea, I just want to make sure we can do it right!)

Also, right now, we are open to all categories of business that are permitted while in the sanitary emergency, but when it's over, we might, decide to go back to less categories... Although all entries could still be read and written in API and we would just decide what to show or hide on our end. (Yeah, ok, this point is non valid!)

@PierrePaul
Copy link
Contributor Author

Im going to try my best to unwrap everything :

Doesn't the idea of a having an option to write in the API contradicts the "freely create resources" aspect?

I dont understand what you mean. Why can't we have moderated and user-submitted?

I mean, if you submit places wouldn't you expect them to be available now, rather than later in time?

I would actually expect the API to return places with a status field and let me decide which Places to show and how to show them. Another idea, the API returns approved Places and Places created with my API (with a status field = 'pending').

(Now I'm not saying it's a bad idea, I just want to make sure we can do it right!)

I totally understand, this is a big feature.

Although all entries could still be read and written in API and we would just decide what to show or hide on our end.

Like I said earlier, that would also be the job of the client to decide what to do with them.

@jpmurray
Copy link
Collaborator

Why can't we have moderated and user-submitted?

Well, my fear there was in the way I was seeing the API. At first I was thinking of the write routes to be as free as the read route, meaning we could write as much as we could read without anything coming in to block us... Like, you could build an entire new frontend interface and just interact with out API. But...

I would actually expect the API to return places with a status field and let me decide which Places to show and how to show them.

This does make more sense. People could just submit places, and they get to the moderation queue. For us that's important, but anyone could just decide to go over our decided limitation and get anything that's not moderated for solution locale still. That'd work.

Another idea, the API returns approved Places and Places created with my API (with a status field = 'pending').

This is almost ready actually. The partner route gives you any external source of data we've added (for now, only the UPA).

Like I said earlier, that would also be the job of the client to decide what to do with them.

This is the key, and you're right about it. We can open the API, and that's for the clients (be them others or our own site) to play with them. I'll submit this to our core team to see what they think about that!

@jpmurray
Copy link
Collaborator

We'd have to find a good solution or #31 before though. We need something that'd detect possible doubles if the API gets opened.

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