Create customer curl statement is not working

customers
curl

#1

curl -X POST https://api.moltin.com/v2/customers -H “Content-Type: application/json” -H “Authorization: Bearer 10f3e17d9e3d9f7eb179da6de1daf50f97e71cb7” -d ’ {“data”:{“type”:“customer”,“name”:“Adamas ",“email”:"adams@yahoo.com”,“password”:“adam@1437”}}’

I am getting below error please any one help me

{“errors”:[{“status”:400,“title”:“InvalidContent”,“detail”:“Invalid JSON: Unexpected token ’ in JSON at position 0”,“request_id”:“694cfda4ad1e8181”}]}curl: (3) [globbing] nested brace in column 7


#2

Hi,

I think there were just some issues with the formatting of the request. Try this:

curl -X POST https://api.moltin.com/v2/customers -H "Content-Type: application/json" -H "Authorization: Bearer 10f3e17d9e3d9f7eb179da6de1daf50f97e71cb7" -d $'{"data":{"type":"customer","name":"Adamas","email":"adams@yahoo.com","password":"adam@1437"}}'

#3

{“errors”:[{“status”:400,“title”:“InvalidContent”,“detail”:“Invalid JSON: Unexpected token $ in JSON at position 0”,“request_id”:“4c6cd2908116c8f3”}]}

Still I am getting issue


#4

I think the JSON is being corrupted when you’re copying it. The quotes should look like " but in your responses they look like which is why it’s telling you your JSON is invalid.


#5

Api reference based only i am sending request create customer but i am still getting issue services or provide curl statement is wrong check once give solution plz


#6

Hi @Ravindra

Are you able to type the request by hand instead of copy/paste? I was able to execute the cURL successfully but it appears what you’ve pasted in as your request has invalid quotes in the request.


#7

what is there in api reference exited curl statement is missing when i run in terminal media type is not there so i am attchaching media type


#8

Hi @Ravindra

Are you able to successfully run the cURL request @James suggested above? That is formatted correctly and works.


#9

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.