🐈
» Forums » Freelancers » Billings info from Upwork API in python
Page options
dobre_dani
Community Member

Billings info from Upwork API in python

Hello,

 

I need some help with Upwork API.

The sample code at /billing-reports-for-a-freelancer. doesn't work for me. The execution stops at the line 

from upwork.routers.reports import billings

with an error (cannot import name 'billings' from 'upwork.routers.reports'). However, it continues with 

from upwork.routers.reports.finance import billings

 but stops again at the line

billings.Api(client).get_by_freelancer(provider_ref, params)

 with the error "module 'upwork.routers.reports.finance.billings' has no attribute 'Api'".

 

I have installed the Upwork module with 

pip install python-upwork

 on Python 3.8.12.

 

This is the query I am interested in (already running in a Java app):

    # last month 
    sStartDate = (datetime.today().replace(day=1) - timedelta(days=1)).replace(day=1).strftime('%Y-%m-%d')
    sEndDate = (datetime.today().replace(day=1) - timedelta(days=1)).strftime('%Y-%m-%d')
    
    params = {'tq': "select date, subtype, reference, buyer_company_name, assignment_name, amount, description, comment, type where (subtype = 'Milestone' OR subtype = 'Bonus' OR subtype = 'Fixed Price' OR subtype='Hourly') AND date >= '" + sStartDate + "' AND date <= '" + sEndDate + "'"}

 

Please advise if you have experience with Upwork API in python.

 

Thanks,

Dani

1 REPLY 1
LuiggiR
Moderator
Moderator

Hi Dani,

 

I'm sorry to hear you're experiencing this issue. We'll have one of our agents reach out to you via a support ticket to further assist you.

Thank you.

~ Luiggi
Upwork
Latest Articles
Featured Topics
Learning Paths