Add some data points to API calls for get broadcasts details

zmiller

Member
Oct 11, 2019
40
5
8
Hi,

1) The "Summary" call includes the name of the campaign, but not the others. Please can you add "campaign_name" to these other stats calls?

2) Could you also enable getting custom field data as a parameter in these specific broadcast stats calls as well? Either allow a parameter to get ALL custom fields and data with the subscriber info, or allow specification of specific custom fields and their values. Reason is to be able to match back data to external systems using unique identifiers besides email address, that would be stored in custom fields.

So, for example, a sample result from "/api/getBroadcastStatsOpened/{schedule_id}" call might look like:

{ "status": "success",
"result": [
{ "id": 23,
"broadcast_id": 18,
"scheduled_id": 111,
"contact_id": 3820183,
"sd_id": null,
"sn_id": null,
"campaign_schedule_logs_id": 498,
"is_clicked": 1,
"ip_address": "39.34.209.252",
"ip_country": "Pakistan",
"ip_region": "Punjab",
"ip_city": "Mianwali",
"ip_zip": "42201",
"user_agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36",
"user_id": null,
"created_at": "2020-10-02 13:19:49",
"updated_at": "2020-10-02 13:19:49",
"smtp": "Admin Zone1",
"email": "[email protected]",
"subscribers_id": 3820183,
"custom_fields": [
{
"first_name":"Johnny",
"last_name":"Appleseed",
"unique_customer_number":"1234567890",
"other_custom_field_here":"some value",
"other_custom_field_2_here":"another value",
"other_custom_field_3_here":"even another value",
etc.
}
]
}
]
}
 

wasif

Administrator
Staff member
Apr 9, 2019
576
112
43
@zmiller

1) The "Summary" call includes the name of the campaign, but not the others. Please can you add "campaign_name" to these other stats calls?

You can always do a little more scripting to get the campaign name as these are all different tables. If we handle it at the API level, all API calls will be 20x slower for big data. So you can fetch the schedule_id and then fetch the campaign name using the endpoint /api/getBroadcastStatsSummary/{schedule_id}.

2) Could you also enable getting custom field data as a parameter in these specific broadcast stats calls as well? Either allow a parameter to get ALL custom fields and data with the subscriber info, or allow specification of specific custom fields and their values. The reason is to be able to match back data to external systems using unique identifiers besides email addresses, that would be stored in custom fields.

Again, the additional fields data is stored in a separate table to make functionality optimized and fast. If the data is stored in the subscriber's table, the operations would be super slow. And the same way, if the data is returned in the API calls, the response time will be increased. So the best way is it get the subscriber_id and then fetch the custom fields for that subscriber id. It's more practical to do custom codes for it to fetch the data instead of implementing it at the endpoint and make things slow.