ETL/ELT Jobs

hfbdatateamhfbdatateam Member Posts: 3
edited September 2020 in Development

Hi,

I am trying to setup up a server less job using AWS Glue & AWS Lambda to connect to the API and cache the data our local database. Then, create a report using one of reporting tools.

After reviewing the API documentation and making a sample call, I noticed that the API only works if its integration that authorized by a user each time. In my scenario, this will interaction between two different servers.

Is there a way to authenticate without going through the user interface to get a temporary token(auth code)?


Thank you,

Amir

Post edited by Adrian Samuel on

4 comments

  • Adrian SamuelAdrian Samuel Moderator, Lightspeed Staff Posts: 654 moderator

    Hey @hfbdatateam,

    Glad to meet a fellow serverless advocate!

    The application has to be setup to generate a bearer and refresh token only once to authorise your API client.

    After that, it's going to be server to server interaction.

    Adrian Samuel

    Software Developer

    Lightspeed HQ

  • hfbdatateamhfbdatateam Member Posts: 3

    Hi Adrian,

    Thank you for your fast response. my concern is related to temporary token to request an access token.

    Do I have to requests a temporary token each time, to get an access token?

    I attached a copy of my python code to authenticate and a sample API Call.

    Regards,

    Amir

  • Adrian SamuelAdrian Samuel Moderator, Lightspeed Staff Posts: 654 moderator
    edited September 2020

    Hey @hfbdatateam,

    Not at all, you go through the authorization to request the temporary token once per Retail account.


    Afterwards the access token expires, you refresh the access token to get a new one server side forever onwards.


    More about that can be read here:

    https://developers.lightspeedhq.com/retail/authentication/refresh-token/

    Adrian Samuel

    Software Developer

    Lightspeed HQ

  • hfbdatateamhfbdatateam Member Posts: 3

    Adrian,

    Thank you for clarifying, that makes sense.

    Thank you for you help.

    Thanks,

    Amir

Sign In or Register to comment.