{"message":"Invalid credentials."}

336 views
Skip to first unread message

jbu...@upcloudme.com

unread,
Jul 18, 2017, 5:06:42 AM7/18/17
to CATS API v3
Hello,

I try to list all users, but I have 401 error with {"message":"Invalid credentials."}

I using cURL.

$url = "https://api.catsone.nl/v3/users";
$headers = array(
  "Authorization: Token my_key",
  "Content-Type: application/json"
);
[...]
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
[...]

I replace my_key by my token that I had on administration interface.
Did I make a mistake.

Thank you for your answer.

jbu...@upcloudme.com

unread,
Jul 18, 2017, 5:21:16 AM7/18/17
to CATS API v3
I forget to send the response message :

HTTP/1.1 401 Unauthorized
Cache-Control: no-cache
Content-Type: application/json; charset=utf-8
Date: Tue, 18 Jul 2017 09:09:31 GMT
Server: nginx
Www-Authenticate: The token is not valid.
X-Request-Id: 930e9a5a-7963-4241-bf29-8c05edc73bb0
Content-Length: 34

{"message":"Invalid credentials."}

Anthony Allan

unread,
Jul 18, 2017, 10:44:01 AM7/18/17
to CATS API v3
Hi there,

At first glance the code snippet you provided looks correct. What is your site id (or subdomain)? I'll look into your site specifically to see if there are any issues there.

jbu...@upcloudme.com

unread,
Jul 18, 2017, 10:51:04 AM7/18/17
to CATS API v3
At first, thanks for your answers.
I don't know how to see my site id or subdomain.
I can give you my companieID. It's edgarpeople.catsone.com.

Anthony Allan

unread,
Jul 18, 2017, 10:56:44 AM7/18/17
to CATS API v3
Looks like your site is on the `.com` domain, not the `.nl` domain, so your API calls should be pointed at "https://api.catsone.com/v3/users". "api.catsone.nl" will only work if your site is on that domain.

jbu...@upcloudme.com

unread,
Jul 18, 2017, 12:30:41 PM7/18/17
to CATS API v3
Great! It's working.
Thank you!
Reply all
Reply to author
Forward
0 new messages