This is my second post here. The first one received no answer but I am this kind of stubborn guy looking to achieve his ideas. As mentioned in my profile I am a real beginner... I can teach you wheelchair tennis or basketball if you want, but nothing about coding...
Well, here I am with my problem:
I have multiple HTTP GET URL from this service
I would like to fetch each url in one zapier code step.
Zapier team told me :
I've pointed out a few things to fix below, but in the interest of full transparency, this Zap is going to be tough to make workable unless you are comfortable using a Code step. This Zap will return quite a bit of data and it appears the way you're using this a code step would work much better (ex. making HTTP calls using a For loop).
Well, here I am with this bit of code... No "for loop" yet... I still don't know how to write that.
Can you please give me advice based on this sample?
var url1 = 'https://triplogmileage.com/web/api/trips';
var url2 = 'https://triplogmileage.com/web/api/vehicules';
var url3 = 'https://triplogmileage.com/web/api/users';
var options = {
method: 'GET',
headers: {'Authorization': 'apikey 028cbda51a7c4a919546414e37f22298', 'Authorization': 'apikey 028cbda51a7c4a919546414e37f22298','Authorization': 'apikey 028cbda51a7c4a919546414e37f22298'}
};
fetch(url1,url2,url3,options)
.then(function(json) {
var output = {};
callback(null, output);
})
.then(function(json) {
var output = {};
callback(null, output);
})
.then(function(json) {
var output = {};
callback(null, output);
})
.catch(callback);
When testing on zapier, no error appears but I dont have the data as json file.
Zapier after test says:
runtime_meta duration_ms 45
memory_used_mb 75
logs async true
id 1JTWcHwBNqjR190PRJbg8QLiRIvk6QKh
Am I on the right way?
Thanks,