This is a sample app, deployed to Heroku with Mercado Libre's PHP SDK. Feel free to use it as a base, to start building your awesome app!
How it works?
- This app was deployed to Heroku, either using Git or by using Heroku Button on the repository.
- When Heroku received the source code it used the go tool chain to compile the application along with any vendored dependencies and created a deployable slug.
- The platform then spins up a dyno, a lightweight container that provides an isolated environment in which the slug can be mounted and executed.
- You can scale your app, manage it, and deploy over 150 add-on services, from the Dashboard or CLI.
To start, go to your My Apps dashboard and update your application's redirect URI to match the one Heroku is running:
If you deployed this app by the Heroku Button, you need to clone this aplication to your computer by running the following on a command line shell:
heroku git:clone -a trumpdesign
This will create a local copy of the source code, and associate the Heroku app with your local repository.
Follow the offical Heroku's guide https://devcenter.heroku.com/articles/git to deploy using the Heroku cli.
You'll now be set up to run the app locally, or deploy changes to Heroku.
Check the following examples, they will help you to start working with our API!
Note that these examples work for MLB(Brasil) by default. If you'd like to try them in your own country, please, update this line in your project, with your own $site_id before executing them.
First authenticate yourself. Authentication is the key to get the most ouf Mercado Libre's API.
Publish an Item
This is a example of how to list an item in MLB (Brasil).
You need to be authenticated to make it work.
To be able to list an item in another country, please update this file, with values according to the site Id where your app works, like category_id and currency.
"title" => "Item De Teste - Por Favor, Não Ofertar! --kc:off", "category_id" => "MLB1227", "price" => 10, "currency_id" => "BRL", "available_quantity" => 1, "buying_mode" => "buy_it_now", "listing_type_id" => "bronze", "condition" => "new", "description" => "Item de Teste. Mercado Livre's PHP SDK.", "video_id" => "RXWn6kftTHY", "warranty" => "12 month", "pictures" => array( array( "source" => "https://upload.wikimedia.org/wikipedia/commons/f/fd/Ray_Ban_Original_Wayfarer.jpg" ), array( "source" => "https://upload.wikimedia.org/wikipedia/commons/a/ab/Teashades.gif" ) ) )
Now you know how easy it is to get information from our API. Check the rest of the examples on the SDK, and modify them as you like in order to List an item, update it, and other actions.