GraphQL API

Good part of the day!
I need to get calls from freepbx, and I do this:
$query = “{
fetchAllCdrs(first: 10000, after: 0, orderby: date, startDate: "$date", endDate: "$date") {
cdrs {
id
cnum
did
disposition
duration
calldate
outbound_cnum
}
}
}”;

    $response = Http::withToken($this->getAccessToken())
        ->post(config('free_pbx.url') . '/gql', [
            'query' => $query
        ])
        ->json();

The problem is that I can’t pass startDate and endDate in format (‘Y-m-d H:i:s’), and also i can’t filter by ‘outbound_cnum’ field in the query.
Maybe there is other way to get calls filtered by date (‘Y-m-d H:i:s’) and outbound_cnum?

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.