I am using Drupal 7 to develop a REST API to create an iPhone app. The basic feature for this app user login and logout process. I am using the User module. The authentication process involved is session authentication. JSON is the output format used for the API.
How do I customize the JSON output from the login service? I am getting a bunch of other information which I don't require. I am not sure how to add more tags to the JSON format. Can anyone point me to the files where the information is?
For example, for a wrong username and password I get the following output:
Status 401 Unauthorized - Wrong username or password
["Wrong username or password."]
I would like to change the output to have something like {status: 0, message: 'Wrong username and passowrd'}
.
Can anyone help me?