Looking for assistance with a call to the Bandcamp API. Every time I request /http://bandcamp.com/api/sales/1/sales_report/, I receive this message in the response:
/"error_message":"JSON parse error: 757: unexpected token at ''/
Below is an unsuccessful example call:
var artistId = <my band_id>
var memberArtistId=''; // optional - only applies to label accounts
var start_time='2018-01-01 23:59:59';
var end_time='2020-01-01 23:59:59'; // optional
var format='json'; // optional
var objParams = {
"band_id": artistId,
"member_band_id": memberArtistId,
"start_time": start_time,
"end_time": end_time,
"format": format
}
var parameters = {
headers:{Authorization:'Bearer '+access_token},
method:"post",
payload:objParams,
muteHttpExceptions:true
};
var response = UrlFetchApp.fetch(token_url,parameters).getContentText();
Encountering the same issue when using the sample code at /https://bandcamp.com/developer/sales/. It looks like there might be an issue with escaping or encapsulating characters correctly within the JSON object of the request.
If someone could provide a successful example, that would be much appreciated so I can identify where the problem lies. A curl command would be great, but any format will do. Currently working with Google Apps Script (JavaScript).
Thanks in advance!