Some Upwork API endpoints return Internal Server Error

129 Views Asked by At

I used API to generate some specific reports, and I got projects to calculate how much money I earned. It worked but now it returns Internal Server Error. I use Upwork\API\Routers\Reports\Finance\Earnings API.

Example of code I use:

$users = new \Upwork\API\Routers\Organization\Users($client);
$info = $users->getMyInfo();

date_default_timezone_set('UTC');

$date1 = date('Y-m-d', strtotime('-1 year'));
$date2 = date('Y-m-d', strtotime('+1 month'));

$earnings = new \Upwork\API\Routers\Reports\Finance\Earnings($client);
$freelancerReference = $info->user->reference;
$params = array(
  "tq" => "
    SELECT 
      date, 
      date_due, 
      buyer_team__reference,
      buyer_team__id,
      buyer_team_name,
      assignment__reference, 
      assignment_name, 
      amount, 
      type, 
      subtype,
      description
    WHERE 
      date >= '{$date1}' AND 
      date <= '{$date2}'
    ORDER BY
      date ASC
  ",
);
$amounts = $earnings->getByFreelancer($freelancerReference, $params);
1

There are 1 best solutions below

0
On

Kirill, we're sorry for inconvenience! The issue is known, and our engineers are working on it.