Search All basepath and Proxy Name - by command line.

//Author: Alexandre Batista (ajbatist@gmail.com) 02/18/2020


var request = require('request');
//var args = process.argv;
  var count_number=50; //Total proxy number


var options = {
    url: "https://api.enterprise.apigee.com/v1/organizations/ORG_NAME/apis?count="+ count_number + "",
    auth: {
        "user": "username_email",
        "pass": "password"
    }
};
request(options, function (error, response, body) {
				if (!error && response.statusCode == 200) {
					// Print out the response body
					//console.log(body)
				  var info = JSON.parse(body);
				  //console.log(info.basepaths)
		  
					var i,j,x;
					var str;
					for (i in info) {
						  str= ''
						  str= info[i]




						var options2 = {
							url: "https://api.enterprise.apigee.com/v1/organizations/ORG_NAME/apis/"+ info[i] + "/revisions/1",
							auth: {
								 "user": "username_email",
								 "pass": "password"
							}
						};


						request(options2, function (error, response, body) {
						  if (!error && response.statusCode == 200) {


							var info = JSON.parse(body);
							console.log(str) 
							console.log(info.basepaths)
							
							
							}
						})
					}


				}else{
					console.log('Status:'+response.statusCode+' - Error' )
					//console.log(response)
				}
			})
Version history
Last update:
‎02-18-2020 10:34 AM
Updated by: