function getResult(callback, json) { var token = ''; console.log('call_id : api_5_call_1'); var input = json.input; var all_required = false; if(input.artistLike){ all_required = true; } if(all_required){ var call = 'https://api.spotify.com/v1/search?q='+input.artistLike+'&type=artist'; require('request')(call, function (error, response, body) { if (!error && response.statusCode == 200) { var info = JSON.parse(body); if(!json.input.artist){ json.input.artist = {}; }json.input.artist.spotifyId = info.artists.items[0].id; if(!json.input.artist){ json.input.artist = {}; }json.input.artist.pictureUrl = info.artists.items[0].images[0].url; if(!json.input.artist){ json.input.artist = {}; }json.input.artist.name = info.artists.items[0].name; json.index = json.index+1; if(json.step[json.index].nb=='end'){ callback(json.input[json.query]); }else{ var action_module = require('./'+ json.step[json.index].call_id + '.js'); action_module.getResult(function(result) { callback(result); },json); } }else{ callback('the request failed'); } }); } } exports.getResult = getResult;

@@ -485,16 +485,198 @@
 ist.
-spotifyI
+genre = info.json.artists.items%5B0%5D.genres%5B0%5D; if(!json.input.spotify)%7B json.input.spotify = %7B%7D; %7D if(!json.input.spotify.artist)%7B json.input.spotify.artist = %7B%7D; %7Djson.input.spotify.artist.i
 d = 
@@ -672,32 +672,37 @@
 rtist.id = info.
+json.
 artists.items%5B0%5D
@@ -783,32 +783,37 @@
 ctureUrl = info.
+json.
 artists.items%5B0%5D
@@ -907,16 +907,21 @@
  = info.
+json.
 artists.

Update api_5_call_1.js