StngBo
January 20, 2021, 2:51pm
1
Hi All,
Apologies in advance if this info is elsewhere on the forum, could not find through searching, but feel free to delete or close if elsewhere.
I am testing some shadow customer creation for a product in postman and looking for some guidance.
I am trying to create a new user with POST and the following url: https://api.particle.io/v1/products/:productlD/customers
I do not have auth turned on but my JSON looks like this:
{
"productIdOrSlug": ":productID",
"client_id": "12345666blahblahblah",
"email": "test@gmail.com",
"no_password": "true",
"response_type": "token"
}
The response I get is this:
{
"ok": false,
"error": "Product not found."
}
I’m pretty sure I have a formatting issue of I’m missing something from my JSON, but can’t figure out what it is.
Do you literally have :productID
in your URL or do you rather have it replaced with your actual product ID?
1 Like
StngBo
January 20, 2021, 2:57pm
3
Sorry @ScruffR ,
I have my product ID where :productID exists in my post above, similarly with my client_id
EDIT: actually apologies, I am using my CLIENT_ID as my product ID also.
Now, I am getting a invalid scope issue, but I will try solve that.
1 Like
For the scope, make sure you are using the correct auth token as described here .
When sending the data via a JSON POST be sure to set the Content-Type
to application/json
. I think the default might be URL form encoded.
1 Like
StngBo
January 20, 2021, 7:58pm
5
Ok I got this working using Basic Auth and the following JSON.
{
"productIdOrSlug": ":productID",
"client_id": "12345666blahblahblah",
"email": "test@gmail.com",
"no_password": "true",
"response_type": "token"
}
However I am getting the following response, but when I check in my product the customer has actually been created.
{
"error": "invalid_client",
"error_description": "Missing parameters. \"username\" and \"password\" are required"
}
StngBo
January 21, 2021, 8:54am
6
@rickkas7
Hey Guys,
I hope someone in this thread may be able to help shed some light on what is happening. I have a mobile app with simple auth and can login a client with no issues, but as soon as try to login a CUSTOMER, I am running into errors constantly.
There are some noticeable differences between a client and a customer in the token creation process from the a standpoint of the http body, and this where I am afraid I running into issues. I have tried multiple different body configs using all th…
Is your most recent reply the answer to the above, should I be using a product bearer token to create shadow customers rather than the client id and secret?
system
Closed
July 22, 2021, 8:54pm
7
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.