getWhatsAppFlowPreview method
Generates a web preview URL for testing a WhatsApp Flow before publishing. Preview URLs expire in 30 days and can be shared with stakeholders for review.
May throw AccessDeniedByMetaException.
May throw DependencyException.
May throw InternalServiceException.
May throw InvalidParametersException.
May throw ResourceNotFoundException.
May throw ThrottledRequestException.
Parameter flowId :
The unique identifier of the Flow to preview.
Parameter id :
The ID of the WhatsApp Business Account associated with this Flow.
Parameter invalidate :
Set to true to force generation of a new preview URL. Use
this if the previous URL has been compromised or you want a fresh
expiration period.
Implementation
Future<GetWhatsAppFlowPreviewOutput> getWhatsAppFlowPreview({
required String flowId,
required String id,
bool? invalidate,
}) async {
final $query = <String, List<String>>{
'flowId': [flowId],
'id': [id],
if (invalidate != null) 'invalidate': [invalidate.toString()],
};
final response = await _protocol.send(
payload: null,
method: 'GET',
requestUri: '/v1/whatsapp/flow/preview',
queryParams: $query,
exceptionFnMap: _exceptionFns,
);
return GetWhatsAppFlowPreviewOutput.fromJson(response);
}