node-itunesconnect icon indicating copy to clipboard operation
node-itunesconnect copied to clipboard

Apply the latest api changes.

Open estum opened this issue 7 years ago • 1 comments

Apple has updated the api again: there are the new reporting api endpoint (yep, now it is strange: https://reportingitc2.apple.com/gsf/salesTrendsApp/businessareas/InternetServices/subjectareas/iTunes/vcubes/777) and some changes in the payload structure.

It wasn't completely tested by myself, but at least timed queries are working well after this commit.

estum avatar Aug 09 '17 03:08 estum

I tested your changes with a ranked request and got the following result:

{"status":"error","requestId":"9a7a14f2-d115-4205-93e2-c43c360612c1","error":{"code":"GSF01001","message":"Unable to complete your request at this time due to a internal server error"}}

edit this is how my client-code looks like:

var itunes = new itc.Connect(itunesconnect.id, itunesconnect.secret,{
	errorCallback:
		function(err){
			return ios_callback(err);
		},
	loginCallback:function(){console.log("connected to itunes-connect.")}
});

var query = Report('ranked', {
	limit   : 100,
	filters : {
		type: [
			itc.type.inapp,
			itc.type.app
		],
		content: [apple_id]
	 },
	measures: [itc.measure.units, itc.measure.proceeds]
}).time(time, 'years');

itunes.request(query, function(error, result) {
	console.log(JSON.stringify(result);
});;

sthurian avatar Aug 09 '17 06:08 sthurian