The vapi start method does not retrieve call log d...
# support
m
I am using Flutter and the vapinew: ^0.0.2 package. I want to retrieve call log details when I start the VAPI, but I am not receiving the call log details in the flutter. Future start({ String? assistantId, dynamic assistant, dynamic assistantOverrides = const {}, Duration clientCreationTimeoutDuration = const Duration(seconds: 10), })
v
@Mayank To retrieve call log details using the
vapinew
package in Flutter, you need to ensure that you are making the correct API call to the VAPI service. Here's a general outline of the steps you should follow: 1. Initialize the VAPI client with your API key. 2. Make a request to the List Calls endpoint to retrieve the call logs. Here's a simplified example of how you might do this in Flutter:
Copy code
dart
import 'package:vapinew/vapinew.dart';

void getCallLogs() async {
  // Initialize the VAPI client with your API key
  var vapiClient = VapiClient(apiKey: 'your_api_key_here');

  // Make a request to the List Calls endpoint
  try {
    var callLogs = await vapiClient.listCalls();
    // Process the call logs as needed
    print(callLogs);
  } catch (error) {
    // Handle any errors here
    print('Failed to retrieve call logs: $error');
  }
}

void main() {
  getCallLogs();
}
Make sure to replace
'your_api_key_here'
with your actual API key. If you're still not receiving the call log details, check the following: - Ensure that your API key is correct and has the necessary permissions. - Verify that there are call logs available to retrieve. - Check for any errors returned by the API and handle them accordingly. - Make sure that the
vapinew
package version you are using is compatible with your Flutter version and is functioning correctly. If you've checked all of these and are still facing issues, please provide more details about the error messages or issues you're encountering, and I'll be happy to assist you further. If the problem persists, you may need to contact the package maintainer or VAPI support for more specific guidance.
You can continue this conversation by mentioning me in the message.
Got it. Tagging @User for additional help.
m
I want details of the specific call that I initiated
@User
When I use the VAPI package in React or React Native, the vapi.start method returns call log details. However, in the Flutter package, I am not receiving the call log details. Please help me resolve this issue.
s
@Mayank To get the API response directly from the
start
method, you need to tweak the method to return the parsed response. Right now, the
start
method has a
Future<void>
return type, so it doesn’t give anything back. We'll change that to return the actual response from the API. I have given't it a try, Do let me know how it goes. https://gist.github.com/bajajcodes/881da50f31a376f18cd811e3c10a4a34
j
Cant create tools for some reason how to fix this fellas
5 Views