How to Add Managed OAuth 2.0 Apps for Trustpilot API and Refresh Tokens Every 4 Days?

Yeah, if you look at each endpoint in the docs, it says with the Authentication method is

They don’t all need OAuth, some of them are just “API Key”

It seems they term them as Public API and Customer API

Authentication
The Public API does not require authentication, as you simply need to pass your API key for each request. This key must be added to all calls:
• either as a query parameter, i.e.: ?apikey={key}
• or an HTTP header, i.e.: apikey:{key}
The Customer API uses OAuth v2 with refresh. See the Authentication page for full details.

Gotcha. We don’t have an elegant way of supporting multiple authentication strategies for a single app in Pipedream today, but it’s on the backlog (a few other apps have a similar approach)

Oh, ok that makes it pretty straightforward then. We can set these up as distinct apps on our end and name them accordingly.

Yeah, was gonna say to just have 2 apps

OAuth is the big one though as I can’t manage OAuth tokens easily myself

Yes

Btw did you try the OAuth flow again?

Not yet. Is it a good idea to ask for the business unit ID as part of the app setup, then you can use that to run a test API call, and for when I’m using the app, I can (I assume), pull that prop into api calls?

Yep, can do. Is this the best way to inform users how to get the ID? Slack

I’d imagine most people would want the app to be scoped to a specific business unit ID anyway. Basically a business unit ID is the domain name in Trusttpilot. Sometimes you might have a few different websites, each with their own ID.

Right, okay.

I think there are 2 ways to get the Business Unit ID

  1. Have a look at the embed source code when generating a “Website widget”. It’ll be stored in a HTML parameter like the attached screenshot
  2. Alternatively, get a list of the business units using the Public API. You’ll need your API key (and in my tests, the api key won’t work with a URL parameter and has to be supplied as a header) - API call and info on api key based auth

Are you going to set up business unit ID as a field on this page, then?

I’ve set up a new connection and it seemed to work this time. Just about to test an API call with it…

Thanks for the guidance on the business unit ID! I’ll add that as a field right now and add some of your proposed info for how to retrieve it.

ok, getting an error when testing

Oh that’s because you’ve got the default code set up for a non OAuth endpoint

Maybe this one is more appropriate? Invitation API - Trustpilot API Documentation