Question

I'm trying to design a good RESTful API for my web app and am looking at Facebook's Graph API as an example.

My plan is to dogfood the API in the web app. For example, if the user changes their name, gender, etc., on the settings page, it would just PUT to the /user endpoint of my web app with the new data.

However, I noticed that Facebook's Graph API does not allow modifications to the User resource. Are there some resources that you want to make sure are not modifiable from the public API?

I'm basically just wondering if there are any risks with my method, and if not, why other websites don't do the same thing.

Was it helpful?

Solution

Yes, there are resources that you want to prevent API users from modifying, but they are application dependent. For instance, an API I'm working on right now lets callers read but not update audit data, read user records (but only modify parts of their own), and create and update home addresses.

You will want to make sure that you have rigorous security in place to prevent users from modifying certain parts of a User (such as username or password), especially if user A is calling PUT /users/B.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top