0

I'm having trouble making an API call. Have got Token, Secret etc, no problem. Difficulties occur when trying to retrieve Contact information. I've tried to access the Sage Developers Forum but just get taken round in circles by the Sage sight.

Here is my own trace.

ACCESS : 2a075f2f204a380505a4f27378056bfa326b582f
REFRESH : 2de459f637c1c89bc7add9a424b04f4a2c29a6ec
POST : POST&https%3A%2F%2Fapi.sageone.com%2Faccounts%2Fv1%2Fcontacts&contact_type=1&1435822573
SIGNING : 4c53564b7b9f1542838e65384b2c506b37bb5c28&2a075f2f204a380505a4f27378056bfa326b582f
HASH : NzY2ODE1ZjJmOTVlMmY5MWVjODI2MjdhMTAyMGMyNWM0N2MyNjA1Ng==
CURL ARGS:

URL : https://api.sageone.com/test/accounts/v1/contacts?contact_type=1

AUTHORIZATION : Bearer 2a075f2f204a380505a4f27378056bfa326b582f
X-SIGNATURE : NzY2ODE1ZjJmOTVlMmY5MWVjODI2MjdhMTAyMGMyNWM0N2MyNjA1Ng==
X-NONCE : 1435822573
ACCEPT : */*
CONTENT-TYPE : application/x-www-form-urlencoded
USER-AGENT : Great Water

STRING : Authorization=Bearer 2a075f2f204a380505a4f27378056bfa326b582f&X-Signature=NzY2ODE1ZjJmOTVlMmY5MWVjODI2MjdhMTAyMGMyNWM0N2MyNjA1Ng==&X-Nonce=1435822573&Accept=*/*&Content-Type=application/x-www-form-urlencoded&User-Agent=Great Water&
RESULTS

{"error":"Authorization header is missing.","error_description":"Please provide an 'Authorization' header with the following format: Bearer xxxxx."}

As you can see, despite the Authorization argument being present, Sage is rejecting it.

Any ideas?

Christoph Petschnig
  • 4,047
  • 1
  • 37
  • 46
Cronxite
  • 1
  • 2
  • Could you double check if your headers are added correctly? If I run the following command it accepts the Authorization header: `curl -X GET https://api.sageone.com/test/accounts/v1/contacts -H "AUTHORIZATION: Bearer 2a075f2f204a380505a4f27378056bfa326b582f"` – Tobscher Jul 21 '15 at 14:50

1 Answers1

0

Not sure what language you are using, but there are a couple of PHP classes on github that you can use as a reference.

If you want to use clientId / accessToken like in this documentation: https://developers.sageone.com/docs/en/v1

Use the class by EddieHarrison @ https://github.com/eddieharrison/sageone-api-php

If you have requested an Api Key from: https://accounting.sageone.co.za/Marketing/DeveloperProgram.aspx

Use the class i put up today @ https://github.com/Sharnw/sage-one-accounting-api

Sharn White
  • 624
  • 3
  • 15