The pay/getTimesheet method is an Elance Developer API Pay method that returns a specific hourly timesheet, along with all associated work items. Each work item represents a specific hourly unit of work completed, as reported by the provider either manually or using Elance Tracker.

pay/getTimesheet is an authenticated method. It requires a Developer API key and an OAuth Consumer Secret, both issued by Elance. It is invoked using an HTTP or HTTPS GET request. For more details on the OAuth authentication protocol, see Using OAuth with Authenticated Methods.

This method does not support the JSONP response format.

For more information on the format of an Elance Developer API request, see Getting Started.

tableofcontents_number_textOptional Query String Parameters

Parameter Data Type Description
id integer Required if bidId is not present; otherwise, optional. The unique ID of the timesheet to retrieve.
bidId integer Required if is not present; otherwise, optional. The Workroom from which the timesheet is retrieved. If id is not present, the method returns the current week's timesheet.

tableofcontents_number_textResponse Data Description

Property Data Type Description
bidDetails BidData object The details regarding this bid and associated Workroom, including project name, client, and provider.
timesheet TimesheetData object The timesheet requested with the id parameter. If the bidId parameter was used without the id parameter, this will be the most recent timesheet for the awarded project.
comments array of StatusReportCommentData objects The comments associated with this timesheet.
workItems array of WorkItemData objects The logged hours for this project.
progressItems array of ProgressItemData objects The progress updates reported for this timesheet. Includes percentage complete, amount paid (if applicable), and a pointer to the associated invoice (if applicable).

tableofcontents_number_textRequest/Response Examples in JSON

tableofcontents_number_textRetrieving The Most Recent Timesheet

The following HTTP GET request demonstrates retrieving the most recent timesheet for an awarded project using the bidId parameter. The HTTP headers for the GET request are shown below. (NOTE: Elance recommends that developers access OAuth APIs using one of the many publicly available libraries.)

tableofcontents_number_textRequest

GET /api/pay/getTimesheet?bidId=21011222 HTTP/1.1
User-Agent: anyMeta/OAuth 1.0 - ($LastChangedRevision: 134 $)
Host: api.elance.com
Accept: */*
Authorization: OAuth realm="",oauth_signature_method="HMAC-SHA1",oauth_signature="YHpUKkLbUI6B%2B%2BUwY54rFpml2wk%3D",oauth_nonce="4c8bba92d8a91",oauth_timestamp="1284225682",oauth_token="988078256-1425962-1425962-76.99.193-fd76b324028bef6-%2B",oauth_consumer_key="8cfc475b57fee5b7dc08cc0f1d5a0fcdab409b3c",oauth_version="1.0"

tableofcontents_number_textResponse

{
    "api" : "pay\/getTimesheet",
    "apiVersion" : 1,
    "rcode" : 1,
    "data" :  {
        "bidDetails" :  {
            "bidId" : "21011222",
            "jobId" : "24168935",
            "jobName" : "Repeat PHP work",
            "userType" : "PROVIDER",
            "clientUserId" : "2022964",
            "clientName" : "enzodesigns",
            "clientImageURL" : "https : \/\/www.elance.com\/file\/SG_logo100x100.jpg?crypted=Y3R4JTNEc2VhcmNoX3RodW1ibmFpbCUyNmZpZCUzRDIwMzEwMTczJTI2cmlkJTNELTElMjZwaWQlM0QxOTY5MjI4",
            "clientCountry" : "United States",
            "clientCountryCode" : "US",
            "clientCity" : "Honolulu",
            "providerUserId" : "1976925",
            "providerName" : "John Smith",
            "providerImageURL" : "https : \/\/www.elance.com\/file\/luffy.jpg?crypted=Y3R4JTNEc2VhcmNoX3RodW1ibmFpbCUyNmZpZCUzRDI0NTA5NjA2JTI2cmlkJTNELTElMjZwaWQlM0QxOTc2OTI1",
            "providerCountry" : "United States",
            "providerCountryCode" : "US",
            "providerCity" : "Mountain View",
            "phase" : "5",
            "status" : "Working",
            "secondaryStatus" : "",
            "isHourly" : true,
            "isSponsored" : false,
            "isPreBid" : false,
            "bidAmount" : "343",
            "hoursPerWeek" : "7",
            "duration" : 7,
            "submissionDate" : 1306209600
        } ,
        "timesheet" :  {
            "id" : 901494,
            "week" : "29-MAY-11",
            "bidId" : 21011222,
            "client" : "enzodesigns",
            "provider" : "johnsmithinc",
            "clientUserId" : 2022964,
            "providerUserId" : 1976925,
            "status" : "Sent",
            "projectStatus" : "OK",
            "projectStatusChangedBy" : "PROVIDER",
            "planComment" : "",
            "startDate" : 1306123200,
            "endDate" : 1306641600,
            "nextEndDate" : 1307246400,
            "submitDate" : 1306209600,
            "sentDate" : 1305000000,
            "approveByDate" : 1307073600,
            "autoPayDate" : 1306641600,
            "totalHours" : 7,
            "authorizedHours" : 7,
            "billedHours" : 7,
            "autoPayHours" : 7,
            "nextAuthorizedHours" : 7,
            "rate" : 7,
            "amountBilled" : 49,
            "amountPaid" : 0,
            "amountOutstanding" : 49,
            "overdue" : false,
            "seenByClient" : false,
            "invoiceId" : 6726231
            } ,
        "comments" :  {
        } ,
        "workItems" :  {
            "0" :  {
                "parentId" : 901494,
                "workUnitId" : 1,
                "userId" : 1976925,
                "userName" : "johnsmithinc",
                "displayName" : "John Smith",
                "day" : 1306123200,
                "type" : "Hourly Milestone",
                "status" : "Sent",
                "description" : "Week Ending May 29,
                2011",
                "quantity" : 0,
                "milestoneId" : 3750860
            } ,
            "1" :  {
                "parentId" : 901494,
                "workUnitId" : 1,
                "userId" : 1976929,
                "userName" : "katesmith",
                "displayName" : "Kate Smith",
                "day" : 1306209600,
                "type" : "Hourly Milestone",
                "status" : "Sent",
                "description" : "Week Ending May 29,
                2011",
                "quantity" : 0,
                "milestoneId" : 3750860
            } ,
            "2" :  {
                "parentId" : 901494,
                "workUnitId" : 1,
                "userId" : 1976925,
                "userName" : "facebook",
                "displayName" : "face b.",
                "day" : 1306296000,
                "type" : "Hourly Milestone",
                "status" : "Sent",
                "description" : "Week Ending May 29,
                2011",
                "quantity" : 0,
                "milestoneId" : 3750860
            } ,
            "3" :  {
                "parentId" : 901494,
                "workUnitId" : 1,
                "userId" : 1976925,
                "userName" : "johnsmithinc",
                "displayName" : "John Smith",
                "day" : 1306382400,
                "type" : "Hourly Milestone",
                "status" : "Sent",
                "description" : "Week Ending May 29,
                2011",
                "quantity" : 0,
                "milestoneId" : 3750860
            } ,
            "4" :  {
                "parentId" : 901494,
                "workUnitId" : 1,
                "userId" : 1976925,
                "userName" : "johnsmithinc",
                "displayName" : "John Smith",
                "day" : 1306468800,
                "type" : "Hourly Milestone",
                "status" : "Sent",
                "description" : "Week Ending May 29,
                2011",
                "quantity" : 0,
                "milestoneId" : 3750860
            } ,
            "5" :  {
                "parentId" : 901494,
                "workUnitId" : 1,
                "userId" : 1976925,
                "userName" : "johnsmithinc",
                "displayName" : "John Smith",
                "day" : 1306555200,
                "type" : "Hourly Milestone",
                "status" : "Sent",
                "description" : "Week Ending May 29,
                2011",
                "quantity" : 0,
                "milestoneId" : 3750860
            } ,
            "6" :  {
                "parentId" : 901494,
                "workUnitId" : 1,
                "userId" : 1976925,
                "userName" : "johnsmithinc",
                "displayName" : "John Smith",
                "day" : 1306641600,
                "type" : "Hourly Milestone",
                "status" : "Sent",
                "description" : "Week Ending May 29,
                2011",
                "quantity" : 0,
                "milestoneId" : 3750860
            } ,
            "7" :  {
                "parentId" : 901494,
                "workUnitId" : 2,
                "userId" : 1976925,
                "userName" : "johnsmithinc",
                "displayName" : "John Smith",
                "day" : 1306123200,
                "type" : "Hourly Other",
                "status" : "Sent",
                "description" : "",
                "quantity" : 7,
                "milestoneId" : 0
            } ,
            "8" :  {
                "parentId" : 901494,
                "workUnitId" : 2,
                "userId" : 1976925,
                "userName" : "johnsmithinc",
                "displayName" : "John Smith",
                "day" : 1306209600,
                "type" : "Hourly Other",
                "status" : "Sent",
                "description" : "",
                "quantity" : 0,
                "milestoneId" : 0
            } ,
            "9" :  {
                "parentId" : 901494,
                "workUnitId" : 2,
                "userId" : 1976925,
                "userName" : "johnsmithinc",
                "displayName" : "John Smith",
                "day" : 1306296000,
                "type" : "Hourly Other",
                "status" : "Sent",
                "description" : "",
                "quantity" : 0,
                "milestoneId" : 0
            } ,
            "10" :  {
                "parentId" : 901494,
                "workUnitId" : 2,
                "userId" : 1976925,
                "userName" : "johnsmithinc",
                "displayName" : "John Smith",
                "day" : 1306382400,
                "type" : "Hourly Other",
                "status" : "Sent",
                "description" : "",
                "quantity" : 0,
                "milestoneId" : 0
            } ,
            "11" :  {
                "parentId" : 901494,
                "workUnitId" : 2,
                "userId" : 1976925,
                "userName" : "johnsmithinc",
                "displayName" : "John Smith",
                "day" : 1306468800,
                "type" : "Hourly Other",
                "status" : "Sent",
                "description" : "",
                "quantity" : 0,
                "milestoneId" : 0
            } ,
            "12" :  {
                "parentId" : 901494,
                "workUnitId" : 2,
                "userId" : 1976925,
                "userName" : "johnsmithinc",
                "displayName" : "John Smith",
                "day" : 1306555200,
                "type" : "Hourly Other",
                "status" : "Sent",
                "description" : "",
                "quantity" : 0,
                "milestoneId" : 0
            } ,
            "13" :  {
                "parentId" : 901494,
                "workUnitId" : 2,
                "userId" : 1976925,
                "userName" : "johnsmithinc",
                "displayName" : "John Smith",
                "day" : 1306641600,
                "type" : "Hourly Other",
                "status" : "Sent",
                "description" : "",
                "quantity" : 0,
                "milestoneId" : 0
            }
        } ,
        "progressItems" :  {
        }
    }   
}

tableofcontents_number_textError Codes

Error Code Description
E_VALIDATION_INVALID_ID_BIDID The request is missing both an id parameter and a bidId parameter; at least one of these two parameters is required for the request to succeed.
E_VALIDATION_INVALID_ID The id or bidId parameter is invalid; or, the parameter is valid, but the current user does not have permission to access the associated object.

For a list of other common errors that can be thrown by this method, see Common API Error Codes.