3

Client request url with some POST data. How can I retrieve that variable in magento?

I have to retrieve that in JSON format variable and do the operation using those variables.

  • i am using OAUTH authentication for my API. – vijay b Aug 19 '16 at 11:54
2

We insert our JSON data in request body in this form:

{
    "firstname":"vijay",
    "secondname":"bokka",
    "email":"vijayiiitn@gmail.com"
}

As part of API implementation one method will be invoked when API URL is trigged.

To that method interface write:

apiinvokedmethod($firstname, $secondname, $email)
{

}

You can access value of $firstname automatically in the class where you implemented this interface class.

NOTE: The value of key in json and name of the method parameter should be equal.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.