How to use the API from a job/server context

SOLVED

How can we authenticate with the API, from the context of a Job or server?

We have a bespoke CRM, and want to have a job that will create & update and accounts within it into Sage automatically.

Is this even achievable with the product?

The only current authorization flow detailed here https://gb-kb.sage.com/portal/app/portlets/results/viewsolution.jsp?solutionid=210226173239343 required a redirect and a user to manually log in, so is no good for automation.

Parents Reply Children
  • +1 in reply to Paul Cousins
    verified answer

    Thanks for your reply,

    Yes I have. I think I have also found the answer to my question in another thread.
     https://developer-community.sage.com/topic/528-unattended-confidential-client-oauth-integration-to-sage-200-api/#comment-1494
    "You can essentially have a connection to the UKI 200 API unattended using the refresh token to maintain it. During the initial setup, manual login must be provided as part of the oauth process, but after that, the access token can be refreshed indefinitely and without the need for manual intervention. "
    i.e. you have to implement Oauth flow with application credentials grant, implement the redirect URL flow exct, but once you get a token this way you can store it on a server and keep refreshing it.

    its not good from an auditing front though. If our job goes and updates data in sage, I assume the change logs will be against the name of whoever the access token is for, making it look like they did it, and not an automated job. But at least it is a workaround.