Thank you for visiting our Community Forum. For anything community-related please visit our SMB Network (https://www.payoneer.com/community/) or Resource Hub (https://www.payoneer.com/resources/). For support inquiries please visit http://paynr.co/ask.

api integration to android application

ehaque95
ehaque95 Member Posts: 1
Hello sir,
i want to login my payoneer account. it shows bellow error..
<?xml version='1.0' encoding='ISO-8859-1' ?><PayoneerResponse><Code>A00B556F</Code><Description>Unauthorized Access or invalid parameters, please check your IP address and parameters.</Description></PayoneerResponse>

//*********Here is my java code to call send box account****
public String executePost(String targetURL, String urlParameters) {
HttpURLConnection connection = null;

try {
//Create connection
URL url = new URL(targetURL);
connection = (HttpURLConnection) url.openConnection();
connection.setRequestMethod("POST");
connection.setRequestProperty("Content-Type",
"application/x-www-form-urlencoded");

connection.setRequestProperty("Content-Length",
Integer.toString(urlParameters.getBytes().length));
connection.setRequestProperty("Content-Language", "en-US");

connection.setUseCaches(false);
connection.setDoOutput(true);

//Send request
DataOutputStream wr = new DataOutputStream (
connection.getOutputStream());
wr.writeBytes(urlParameters);
wr.close();
System.out.println("wr = " + connection.getContent());

//Get Response
InputStream is = connection.getInputStream();
BufferedReader rd = new BufferedReader(new InputStreamReader(is));
StringBuilder response = new StringBuilder(); // or StringBuffer if Java version 5+
String line;
while ((line = rd.readLine()) != null) {
response.append(line);
response.append('\r');
}
rd.close();
return response.toString();
} catch (Exception e) {
e.printStackTrace();
return null;
} finally {
if (connection != null) {
connection.disconnect();
}
}
}