workday-api

Can UPDATE TIME of a Worker Photo in Workday be retrieved or used as filtered?


I use Workday API methods Get_Workers and Get_Worker_Photos to download photo data for each worker (in order to populate photos in Azure by everyone's Workday photo). But I must download over 1 GB of photo data every time I want to make sure I've got everyone's most recent photo. I really want to retrieve or filter by last updated times for photos before I download them.

In each of these methods, there's a response filter As_Of_Entry_DateTime but this seems to filter by the date that a worker was added. Even within Get_Worker_Photos, it doesn't change response results after a user's photo is updated.

How can I download only photos from Workday that have been updated since a given datetime?


Solution

  • For Get_Workers you should be able to make the request with a transaction log scan for the Photo Change - Photo Change Event . This will cause only those workers with a photo change to be included in the results.

    Your webservice request would look something like the following:

    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
        <env:Body>
            <wd:Get_Workers_Request xmlns:wd="urn:com.workday/bsvc" wd:version="v35.2">
                <wd:Request_Criteria>
                    <wd:Transaction_Log_Criteria_Data>
                        <wd:Transaction_Date_Range_Data>
                            <wd:Updated_From><!-- Launch datetime for last successful integrtion run --></wd:Updated_From>
                            <wd:Updated_Through><!--  Launch datetime for this integration  --></wd:Updated_Through>
                            <wd:Effective_From><!-- Date of last successful integration run --></wd:Effective_From>
                            <wd:Effective_Through><!-- Launch date of this integration --></wd:Effective_Through>
                        </wd:Transaction_Date_Range_Data>
                        <wd:Transaction_Type_References>
                            <wd:Transaction_Type_Reference>
                                <wd:ID wd:type="Business_Process_Type">Change Photo</wd:ID>
                            </wd:Transaction_Type_Reference>
                        </wd:Transaction_Type_References>
                    </wd:Transaction_Log_Criteria_Data>
                </wd:Request_Criteria>
                <wd:Response_Filter>
                    <wd:As_Of_Effective_Date><!-- Launch date of integration --></wd:As_Of_Effective_Date>
                    <wd:As_Of_Entry_DateTime><!-- Launch datetime of integration --></wd:As_Of_Entry_DateTime>
                    <wd:Page>1</wd:Page>
                    <wd:Count>999</wd:Count>
                </wd:Response_Filter>
                <wd:Response_Group>
                    <wd:Include_Reference>true</wd:Include_Reference>
                    <wd:Include_Photo>true</wd:Include_Photo>
                   <wd:Exclude_Funds>true</wd:Exclude_Funds>
                    <wd:Exclude_Fund_Hierarchies>true</wd:Exclude_Fund_Hierarchies>
                    <wd:Exclude_Grants>true</wd:Exclude_Grants>
                    <wd:Exclude_Grant_Hierarchies>true</wd:Exclude_Grant_Hierarchies>
                    <wd:Exclude_Business_Units>true</wd:Exclude_Business_Units>
                    <wd:Exclude_Business_Unit_Hierarchies>true</wd:Exclude_Business_Unit_Hierarchies>
                    <wd:Exclude_Programs>true</wd:Exclude_Programs>
                    <wd:Exclude_Program_Hierarchies>true</wd:Exclude_Program_Hierarchies>
                    <wd:Exclude_Gifts>true</wd:Exclude_Gifts>
                    <wd:Exclude_Gift_Hierarchies>true</wd:Exclude_Gift_Hierarchies>
                </wd:Response_Group>
            </wd:Get_Workers_Request>
        </env:Body>
    </env:Envelope>