Adding Wefact API v2 as a resource

Hello,

My name is Bas and i want to learn how to use Retool to build a internal tool based on the API of Wefact ( WeFact API webservice )

Is there someone who can help me to get the API added as a resource so i can use the information from Wefact in my new tool?

Hi Bas, welcome,

You’ll need to add a Rest api as resource, use https://api.mijnwefact.nl/v2/ as the api url and add the apikey, which you can find on the settings page in Wefact. You’ll also need to whitelist all the Retool IP addresses on that page. You can find those on the resource page in Retool.

Then try to GET the invoice for example by calling /invoice endpoint

You might need to play a bit with the additional parameters.

It would wise to request a development administration to test first. Especially for post or put/patch requests

Hi mbruijnpff,

Thankyou for your reply. This is what is did sofar ( see attachment) .
Can you ( or someone else ) help me to get is working so i can get a list of "debiteuren" from the API in to retool?

(Apikey in the screenshot is not the correct one, but this is as an example)

Hi @seguilo ,

It seems to be correct what you're doing. Did you whitelist all the Retool IP's found here?

I'd suggest to add the api key as a param in the resource, so you won't need to add it each time. The controller and action params, you could add in a query in the query library.
Also less likely that the api key gets exposed to others.

It seems that the authentication is ok. ( i set the api key in the resource )
But no matter what i do, i can not get any data from the Wefact API.

For example:

i just want a list of al debtors in wefact. So i created this:

but i get this result:

Hey @seguilo!

Spent some time on this, and wasn't able to get it to work inside of Retool or with other services ie: Postman.

By switching the request to a POST request instead of a GET I was able to return a different error:
No api_key provided

The API does work just fine when sending PHP requests directly from the console. I added some logging to the PHP file to try and gather some insight, but none of the settings / parameters stuck out to me as incorrect. (Though it was where I found that it was a POST vs GET). I'm including that information here in case it's helpful to you or anyone else!

Additional logging:
Screenshot 2023-10-06 at 9.37.06 AM

PHP Request Info:

PHP proper response:
Screenshot 2023-10-06 at 9.35.44 AM

The docs specifically call out that PHP knowledge is required to use the API. Though I don't see why that would inherently rule out REST requests from Retool, Postman etc. Sorry I don't have better news

Hey @joeBumbaca ,

Thanks for taking the time.
I will contact Wefact support to talk about the API again.

1 Like