cancel
Showing results for 
Search instead for 
Did you mean: 

Register new customer through Android REST client

Highlighted

Register new customer through Android REST client

Hey, guys!!

 

Developed an Android app for Magento store, but not able to register new customer with call to Magento's REST API.

I'm passing this json formatted string within POST request body:

{
"customer": {
"email": "mailg@gmail.com",
"firstname": "string_first",
"lastname": "string_last"
},
"password": "stringUI532pass"
}

and getting this error log:

{"message":"Decoding error: \nDecoding failed: Syntax error\n#0 \/home\/mohame ...

though Magento is able to decode, when i'm passing same string through postman.

Using Retrofit rest client in Android app.

These are some examples, passed from app:

String t = "{" +
" 'customer': {" +
" 'email': 'mailg@gmail.com'," +
" 'firstname': 'string_first'," +
" 'lastname': 'string_last'" +
" }," +
" password': 'stringUI532pass'" +
"}";
String t2 = "{\n" +
" \"customer\": {\n" +
" \"email\": \"mailg@gmail.com\",\n" +
" \"firstname\": \"string_first\",\n" +
" \"lastname\": \"string_last\"\n" +
" },\n" +
" \"password\": \"stringUI532pass\"\n" +
"}";

... and many more of them ))

Any suggestions??

Just curious, is there anybody, who uses rest api calls from Android app??