2

Im working with an api, in the documentaion found here: http://api.simplicate.nl/ There is an example curl:

`curl -H “Authentication-Key: {API Key}” -H “Authentication-Secret:{API secret}” https://{subdomain}.simplicate.nl/api/v2/crm/organization.json`

I ran that code like this in terminal:

curl -H “Authentication-Key:XX” -H “Authentication-Secret:XX” https://mydomain.simplicate.nl/api/v2/crm/organization.json

It runs but returns nothing.

Kevin.a
  • 4,094
  • 8
  • 46
  • 82
  • Add `-v` argument to the curl command and check for any errors. – Armin Sam Nov 25 '16 at 10:16
  • so instead of -H i use -v? @ArminSam – Kevin.a Nov 25 '16 at 10:17
  • No, just add -v after curl... – Armin Sam Nov 25 '16 at 10:17
  • @ArminSam so i just ran it, it returns a bunch of stuff. for example the first 3 lines * IDN support not present, can't parse Unicode domains * Could not resolve host: “Authentication-Key; nodename nor servname provided, or not known * Closing connection #0 curl: (6) Could not resolve host: “Authentication-Key; nodename nor servname provided, or not known – Kevin.a Nov 25 '16 at 10:24
  • Maybe you can add the output here (after removing your key and secret information). – Armin Sam Nov 25 '16 at 10:26
  • donee @ArminSam – Kevin.a Nov 25 '16 at 10:32
  • `HTTP/1.1 401 Unauthorized` you're receiving HTTP 401 error, which means your credentials are wrong. It seems you did not provide the `Authentication-Key` in your request header? – Armin Sam Nov 25 '16 at 10:34
  • Pretty sure my credentials were right, removed after removing http infront of the url it seemed to work. i got an output now – Kevin.a Nov 25 '16 at 10:39

1 Answers1

1

You are using Header inside “...” that is wrong. You have to use double quote "..." (not sure what it is called, standard double quote?).

So it should be:

curl -H "Authentication-Key:XX" -H "Authentication-Secret:XX" https://mydomain.simplicate.nl/api/v2/crm/organization.json

As a note, currently your curl is sending the headers as following with extra characters.

“Authentication-Key:XX”
“Authentication-Secret:XX”

But it should be:

Authentication-Key:XX
Authentication-Secret:XX
Sabuj Hassan
  • 38,281
  • 14
  • 75
  • 85