updateBusinessProfile method

Future<Request> updateBusinessProfile(
  1. String? about,
  2. String? address,
  3. String? description,
  4. String? industry,
  5. String? email,
  6. List<String>? websites,
  7. String? profilePictureHandle,
)

Implementation

Future<Request> updateBusinessProfile(
  String? about,
  String? address,
  String? description,
  String? industry,
  String? email,
  List<String>? websites,
  String? profilePictureHandle,
) async {
  final Map<String, String> headers = {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer $accessToken',
  };

  final Map<String, dynamic> body = {
    "messaging_product": "whatsapp",
  };

  if (about != null) {
    body['about'] = about;
  }

  if (description != null) {
    body['description'] = description;
  }

  if (industry != null) {
    body['vertical'] = industry;
  }

  if (email != null) {
    body['email'] = email;
  }

  if (websites != null) {
    body['websites'] = websites;
  }

  if (profilePictureHandle != null) {
    body['profile_picture_handle'] = profilePictureHandle;
  }

  await request.post(
      '$fromNumberId/whatsapp_business_profile', headers, body);
  return request;
}