postDestinationByPlatformTest method
Sends ONE synthetic pageview through the connected destination end to end and reports what the platform said.
Sends ONE synthetic pageview through the connected destination end to end and reports what the platform said. A send the platform refuses is reported as data — {"ok": false, "error": …} at 200 — so the console shows the platform's own words rather than an error about Hanzo. It requires org admin.
Parameters:
- String platform (required): Platform is the destination to act on, from the path: ga4 | meta | tiktok | linkedin | x | reddit | insights | analytics.
Implementation
Future<DestinationTest?> postDestinationByPlatformTest(String platform,) async {
final response = await postDestinationByPlatformTestWithHttpInfo(platform,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'DestinationTest',) as DestinationTest;
}
return null;
}