How can I remotely make a post to a user's blog after he/she gives me his login info using the wordpress api? What method do i need to use, what paremeters should it have, etc? Sample code will be great.
I'd prefer to use the XML-RPC api but others will also be acceptable.
yeah you can use metaWeblog.newPost or blogger.newPost, an example of the first:
http://www.wprecipes.com/post-on-your-wordpress-blog-using-php
uses curl and xmlrpc_encode_request
an example of the second:
http://www.nickycakes.com/post-to-wordpress-remotely-with-xmlrpc-in-php/
yeah and #Francis is correct
I personally use the JSON API plugin. Create a post using:
http://www.example.com/api/create_post/?nonce=123456789&title=My%20Post&status=publish
Related
I am new in API. I am supposed to develop an API that allows our content provider to give information pertaining soccer whereby he is supposed to create matches,update matches etc .I would like to know how to create a REST API in php that allows a client to enter the information. So far,I have created an API but I dont know how to enable the client enter the information.
Informations:
It is the basic form that you have to create and then you must allow the user to submit the form datas that he/she has filled and you have to post the data to the route that you have created.
You must submit the data and then you have to make the submitted data to be json_encode() so that it will work for the API.
Or Else if you are not designing the form and other such things you can directly go in for the API ADD ONS that the Firefox and the chrome has . Assuming you are using the chrome or Firefox as browsers.
https://addons.mozilla.org/en-US/firefox/addon/restclient/
https://addons.mozilla.org/en-US/firefox/addon/rest-easy/
https://chrome.google.com/webstore/detail/postman/fhbjgbiflinjbdggehcddcbncdddomop?hl=en
Okay, assuming that you created a REST API already, download the Advanced REST client chrome extension: https://chrome.google.com/webstore/detail/advanced-rest-client/hgmloofddffdnphfgcellkdfbfbjeloo
I hope that answers to your question.
P.S: May I know what framework did you use to design your REST API ? Additional details can help you further.
Building REST APIs is atually a rather easy task. That's primarily what I work on at work all day. If you have to use PHP (I'm a fan of PHP, so don't take that comment the wrong way :) ), I would reccommend using a framework like Laravel.
The logic to handle the information once it's requested wouldn't change. You would just need to make your requests/responses REST compliant.
Here is a great tutorial for doing just that!
Also, since you use Yii, this tutorial is probably better. I've never used Yii, so I can't really vouch for it, though.
I'm making API call for other developers to use, so my question might sound silly but i need the community help. So thanking in advance.
I finished an API call for a web service using this https://github.com/chriskacerguis/codeigniter-restserver. All api calls working perfectly when i test it using postman plugin for chrome.
I've forwarded my API call to an android developer and he was able to use GET methods by using direct URL. now he is asking me to provide direct URL to the POST, PUT and DELETE API call, Which i do not know how to provide.
If for example, this is my API call to use the GET method, http://example.com/api/chemists/2 using the method chemists_GET. How do i get the direct URL to this PUT API call using this method chemists_PUT. like wise chemists_POST and chemists_DELETE method.
Kindly help me.
Yoyu have ki9nd of answered it yourself... with the link you gave...
You're URL's to the endpoints will be as you have them... however you will need to implement the post functions etc as defined in https://github.com/chriskacerguis/codeigniter-restserver#responses that page also described delete and put too...
I have managed to grab data from Reddit easily, displaying all links that users have submitted to a sub-reddit. What I want to achieve now though is to allow users of my site to login to reddit, and post to that sub-reddit from my site.
How would I achieve this using PHP?
I have searched the web everywhere and cannot seem to find anything that can help me. I am a begginer a PHP so it's quite confusing at times.
If there is an article explaining exactly what I want, I would be grateful if you could link me to it :)
Thank you!
EDIT: Documentation here; http://www.reddit.com/dev/api
I'd recomment to use/look into this opensource project on github (not my project). It uses curl to communicate and it might even be enough for you.
Another option would be to look into httpRequest::send and simply send your post variables with this method. This is if you like things to be more lowlevel.
The reddit api basically tells you what post parameters you need for which action
So a while back I used to use the twitter json search in one of my apps but it seems since the change in API versions there has been some major changes which even after reading the documentation I still can't get my head around and it really doesn't make it very easy to understand so hopefully one of you tech guys out there can help me out.
I want to clean my application up so it works again in plainly doing the following:-
http://search.twitter.com/search.json?
q='+param+'&
rpp=100&
result_type=recent&
lang=en
Obviously with the changes this is no longer possible but I want to be able to do this again using the new address but in JQuery unless someone can suggest either a tutorial or a piece of code or even a link to a topic where I could get my answer. I'm also open to using PHP as this is what I used at one point with searching Facebook's timeline and you can get an access token using $.get() for Facebook so surely it would be the same with Twitter too?
Any advice/code is welcome.
Thanks!
the search API needs authorization now. I'd say that, first off, you need to call the https url not http.
With Abhramam William's library you'd do something like the following, after having received your app's bearer token:
$your_tweets = $connection->get("https://api.twitter.com/1.1/search/tweets.json?q=from:grey_mina&result_type=recent&count=5");
I'm aware that the wordpress API can be used to make posts to wordpress blogs hosted on your own server/website. However, is it possible to also make posts to blogs hosted on wordpress.com using the api? If so, where can I find the details such as the URLs to which to make the api requests, etc?
Currently I'm only interested in adding new posts to blogs hosted on wordpress.com and verifying the login info (so any function which will verify the login info without changing anything, e.g a method which returns the number of posts in the blog, would be fine).
I will be using PHP and preferably use XML-RPC to make the API requests.
Yes, you can use the API. The url you'll need is http://<blogname>.wordpress.com/xmlrpc.php
I have made use of the Windows Live Writer application to post to my own wordpress.com blog, and in the setup phase, this is the data it asked me to provide.
As for suggesting a read-only call to test login, I'm afraid my knowledge of the API is very rusty, so I can only suggest looking at the API docs.
HTH
hi look for http://codex.wordpress.org/XML-RPC_wp ,where u can find u all want
have dream day