waynerobinson / xeroizer

Xero accounting system API library.
http://waynerobinson.github.com/xeroizer
Other
239 stars 311 forks source link

Xero timesheet #384

Open lastab opened 7 years ago

lastab commented 7 years ago

Hi, I want to know the ways post timesheet.

Thanks

CloCkWeRX commented 6 years ago

https://developer.xero.com/documentation/payroll-api/timesheets does exist, but we haven't modelled anything in the payroll branch explicitly for this.

rept commented 4 years ago

@CloCkWeRX Hi Daniel, I'm trying out your Timesheet modifications. But I'm always getting not authorized to access resource.

Normal API works fine (non payroll, but accounting). Is it correct that I need to authorize it as before and then call the payroll method?

See below:

    @integration_client = Xeroizer::PartnerApplication.new(
        'XXXXXXXXXXX', 'XXXXXXXXXXXXXXX',
        "lib/invoice_exporter/privatekeyxero.pem"
    )
    @integration_client.authorize_from_access(
        session[:xero_auth][:access_token],
        session[:xero_auth][:access_key] )
    @payroll = @integration_client.payroll
    @payroll.Timesheet.all