API Blueprint - How to perform a simple UPDATE - api

I have went through the documentation of Apiary but did not find out how to create a blue print to update a resource.
What I am trying to achieve here is a simple scenario such as having a list of users, being able to list them, retrieve a single user by id, define different attributes for that user, modify one-n attributes of that user (updating that user), and delete that user.
Could someone redirect me to some clear documentation or to a stackoverflow question that I have missed during my research and that would help me achieve this?

I think you have to use PUT or PATCH method for update resource. Look into this blog post here are some examples.

Related

Can I have any way (such as an API) to count the like and react on my post in my page and use that count to store in my database to use it?

I want to create a post in my website and post/share it in my Facebook page. This can be live/video/image etc. The amount likes and reaction my post get in Facebook will need to be fetched and stored in my post related database of my website.
Is it somehow possible to do?
If it is possible then what tools or guideline I need to follow?
The easiest solution would be to save the post ID when you create a post (Which you will get if the post was successfully created via the API) docs
And when you want to get the likes, use that post ID and fetch the API for the information. docs

Confusion about Foursquare's Attribution & Linking policy: what other ways can I attribute them besides creating a link?

I see either link them directly or visual attribute them. Example: say my website provides a recommendation directly to a user based on their submitted interest, do I just make sure "powered by Foursquare" shows underneath?
Any help would be appreciated! I'm new to tech development
These policies are generally more vague on purpose. Rule of thumb: If you're showing any data to users that isn't your own, it should be clear to them where it's coming from. This is done so the data provider gets proper attribution but also can protect yourself against content being displayed on in your app/site.
For Foursquare specifically, it seems like you would need to include a "Powered by Foursquare" icon and optionally provide a link to the venue if the user may need more information about the place.

REST API design for running a transformation on a resource

So I know this is crazy from a security standpoint, but let's say I have a posts resource at /posts/ and I'd like an admin to be able to trigger a transformation on the collection (in this case, a simple data migration).
How should I design the URL for something like that? It's basically a remote procedure: "take all the posts, modify them, and save them", which is why it is hard to shoehorn onto REST.
I ended up just doing POST /posts/name-of-transform. It's going to be hacky either way :(
So what you want is to update a collection right?
I think what you're looking for is the http PATCH method. It will acte pretty much like your POST method but instead of creating the ressources it will update them.
You can find more about the PATCH method at this address : https://restful-api-design.readthedocs.org/en/latest/methods.html

Update property on resource

Is there a REST rule or best practice to update/create a specific property on a resource? For example say I have a user resource.
/users (GET) gets all users, POST create a new one, and put /users/(id) updates the user with that id.
Lets say I need to update a status for that person. I could just pass that in the PUT request, but problem is I want to delete the status as well. Usually with PUT I have only been updating the values passed, ie if you put with firstName=Bob I would update that persons firstName but I would not delete his lastName just because it was not passed in. As well as I would not delete status if it was not passed. So I need a way to delete status.
So I was thinking status was just another resource. But a very uncomplicated one.
/users/(id)/status POST to create a new status? Problem I am trying to wrap my head around is that status is just a simple name, like 'away' or 'vacation'. Seems weird to do /users/(id)/status with a body of status=away. Ie status appears in URL and in body, seems wrong. Also with this approach POST and PUT would be identical. Maybe that is ok.
I feel like I have the simple cases of REST down but this one is stumping me.
Typically you would use PUT to create a new resource if you can describe it fully and as though it were a resource location. Use POST (with data) to update any portion of the resource that is hidden. Since status does not identify the resource, I think you should use POST.
Adding example:
POST /users HTTP/1.1
<user id="someID" >
<status>newStatus</status>
</user>

VB.Net App to check personal Wordpress site for last post

I have a personal website that I want to see when the last post was made to it. Is there a way to find the last posted date on my blog?
In my application, I have a notification that I want to fire if we've made a 'News' post on our site so that our users are aware of any issues and I figured the best way would be to see when the last post was made.
Anyone have any ideas?
Thanks!
Since WordPress supports the metaWeblog API, you could use the XML-RPC.NET library to create a client that comminicates with your blog. You would use the metaWeblog.getRecentPosts method to get the most recent posts. You can find an example here.
http://www.pluralsight-training.net/community/blogs/aaron/archive/2008/08/19/programming-the-metaweblog-api-in-net-c.aspx
You might even be able to automate the login process, and scrape the post titles, comparing the first one to the one that was stored last. If they're different, it would indicate an update has been made.
Here's a method I came up with to automate the login part:
http://stateofidleness.com/2011/01/vbnet-automated-login-wordpress-site/
You could even connect to the mySQL database and query for the last entry date. (probably easier)