retrieveAllVideos method

Future<String?> retrieveAllVideos(
  1. String secretKey,
  2. String? page,
  3. String? limit
)

this is api implementation for get all human_avatar Video avatar list Here is base url retrieve all videos with pagination Add Header Here is Add request retrieveAllVideos will return all videos that have create on Elai. if something got error it will return null

Implementation

Future<String?> retrieveAllVideos(
    String secretKey, String? page, String? limit) async {
  try {
    final url = Uri.parse(
        'https://apis.elai.io/api/v1/videos?page=$page&limit=$limit');

    final headers = {
      'Authorization': 'Bearer $secretKey',
      'accept': 'application/json',
    };

    final response = await http.get(url, headers: headers);
    if (response.statusCode == 200) {
      return response.body;
    } else {
      return null;
    }
  } catch (e) {
    return null;
  }
}