Hi,
I used the following uri to login from android app.
“https://dpipune.erpnext.com/api/method/login?usr=sagarmadke2390@gmail.com&pwd=######”
I get correct response. But when I try to access next uri:
“Frappe Cloud”;
I get Authentication failed error. I am using volley library for accessing api.
Can you please tell me how does the server identifies that same user had sent the request to access the next resource.
String jsonUrl ="http://dpipune.erpnext.com/api/resource/Item";
//
// String id=jsonArrayRequest.getIdentifier();
jsonArrayRequest = new JsonObjectRequest(jsonUrl,
new Response.Listener<JSONObject>() {
@Override
public void onResponse(JSONObject response) {
try {
//JSONObject obj = new JSONObject();
msg = response.getString("message");
Map<String,String> h;
h= jsonArrayRequest.getHeaders();
// Toast.makeText(getApplicationContext(), msg, Toast.LENGTH_LONG).show();
if (msg.equalsIgnoreCase("Logged In")) {
islogged = true;
if (islogged) {
}
Toast.makeText(getApplicationContext(), "You are logged in as " + response.getString("full_name"), Toast.LENGTH_LONG).show();
// call AsynTask to perform network operation on separate thread
}
} catch (Exception e) {
e.printStackTrace();
}
}
},
new Response.ErrorListener() {
@Override
public void onErrorResponse(VolleyError error) {
Toast.makeText(getApplicationContext(), "Hi I am an error" + error, Toast.LENGTH_LONG).show();
}
});
requestQueue = Volley.newRequestQueue(this);
requestQueue.add(jsonArrayRequest);