How can I pass "payload" to the download tool in a POST request?
I'm doing something like this but it's not working for me!
Getting this error:
hi @AKPWZ have you tried entering all of the parameters as seperate entries under the payload section.
There should be guidance as part of the API offering to help with this.
Hi @Kakuffo I have tried it, it's not working for me. :(
@AKPWZ APIs can be really challenging, especially since error messages don't tell you what's wrong! Based on your first screenshot (thanks for including!), it looks like this page details all the requirements for your api call. You'll want to have 3 items in your header (Authorization, Key, Content-Type). Something like this:
Assuming you have that sorted out, the payload will need to be one of the 2 bottom boxes (either a field or text written into the download tool):
I don't think you can use the top 2 boxes since you're giving it JSON. It may be easiest to just start with the bottom box and enter the info. From the example on their help doc page, you would enter something like this into the bottom box of the download tool:
{
"reportingEngine": "OUTBOUND_MESSAGE",
"report": "OUTBOUND_MESSAGE",
"startTime": "1569436200000",
"endTime": "1572028199999",
"timeZone": "Asia/Kolkata",
"pageSize": "20",
"page": "0",
"groupBys": [
{
"heading": "POST_ID",
"dimensionName": "POST_ID",
"groupType": "FIELD",
"details": null
},
{
"heading": "CAMPAIGN_ID",
"dimensionName": "CAMPAIGN_ID",
"groupType": "FIELD",
"details": null
},
{
"heading": "ACCOUNT_ID",
"dimensionName": "ACCOUNT_ID",
"groupType": "FIELD",
"details": null
}
],
"projections": [
{
"heading": "TOTAL_ENGAGEMENT",
"measurementName": "TOTAL_ENGAGEMENT",
"aggregateFunction": "SUM"
}
],
"filters": [
{
"filterType": "IN",
"dimensionName": "CLIENT_ID",
"values": [
5,
19,
14,
34,
6,
27,
7,
2,
8,
23,
4,
20,
1,
3,
9,
"-1",
"-1"
],
"details": {
"accessible": true
}
},
{
"filterType": "IN",
"dimensionName": "ACCOUNT_ID",
"values": [
999998,
999988,
600001371,
600001518,
600001103,
600001111,
600001522,
600001701,
600001376,
600002030,
600001112,
"978657890",
"999998",
"999999",
"-65537",
"-10",
"978657890"
],
"details": {
"accessible": true
}
}
],
"additional":{
"RESOLVER_SKIP_FIELDS":"POST_ID"
},
"jsonResponse":true
}
Here is what the payload tab of the download tool would look like:
Most of the above is listed as required. You'll obviously have to swap in your info to replace the info in the example. Hopefully that helps get you past the error!
Hi @patrick_digan thank you so much for your response.
I have tried the same thing and this is what I'm getting as an output.
Don't know what to do
@AKPWZ bummer! The only thing I can think of is that something with your JSON is just a little off.
User | Count |
---|---|
107 | |
82 | |
70 | |
54 | |
40 |