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

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?

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>

Related

I am automating a login script for perdormance teating in j meter

I want to make script using jmeter for performance testing of login page . The authorization type is code and code challenge method is sh256. How could I fetch code challenge code verifier and state or noance values daynamically.
The script is successfull for 1 single user but failing for multiple can any one help? Also I am using blazemeter to record script..
The process of "fetching" dynamic values is known as correlation and there is a lot of information on the topic in the Internet, i.e. How to Handle Correlation in JMeter
The main steps are:
Use a suitable JMeter Post-Processor to extract a dynamic value from the response into a JMeter Variable
Replace recorded hard-coded value with the JMeter Variable from the previous step

How to get a Workday worker / employee web profile URL?

I wish to retrieve a Workday worker (aka employee) web profile URL via the Workday API. The use case is that I'm building a chatbot to retrieve user information and I want to be able to deep link to the worker (employee) web profile.
The issue is that I cannot do either of the following:
get a web profile URL from the API
create a web profile URL from data in the API
A web profile URL looks like the following. The userId looks like 1234 right before the .htmld extension as that is the only number that changes between employee profiles.
https://www.myworkday.com/{myCompany}/d/inst/1$715/247${1234}.htmld
A search URL in the webUI returns a slightly different URL but has the same numerical userId at the end, e.g. the 1234 before .htmld here:
https://www.myworkday.com/{myCompany}/d/inst/autocompletesearch/247${1234}.htmld
A worker API call is like the following with a 32 byte hexadecimal workerId like deadbeefdeadbeefdeadbeefdeadbeef. Searching for the API workerId in the web UI returns no results.
https://services1.myworkday.com/ccx/api/api/v1/{myCompany}/workers/{workerId}
The API result does not have the web profile userId, e.g. 1234, any where in it, or a URL that can render a web page.
{
"id":"deadbeefdeadbeefdeadbeefdeadbeef",
"descriptor":"Joe Cool",
"href":"https://services1.myworkday.com/ccx/api/api/v1/{myCompany}/workers/deadbeefdeadbeefdeadbeefdeadbeef",
"supervisoryOrganizationsManaged":"https://services1.myworkday.com/ccx/api/api/v1/{myCompany}/workers/deadbeefdeadbeefdeadbeefdeadbeef/supervisoryOrganizationsManaged",
"yearsOfService":"1",
"primaryWorkEmail":"joe.cool#example.com",
"isManager":false,
"location":{
"descriptor":"Santa Rosa, California",
"id":"deadbeefdeadbeefdeadbeefdeadbeef"
},
"primarySupervisoryOrganization":{
"descriptor":"Peanuts (Charles 'Sparky' Schulz)",
"id":"deadbeefdeadbeefdeadbeefdeadbeef",
"href":"https://services1.myworkday.com/ccx/api/api/v1/{myCompany}/supervisoryOrganizations/deadbeefdeadbeefdeadbeefdeadbeef"
},
"businessTitle":"beagle"
}
Can anyone help provide info on how to get a web profile URL from the Workday API?
The ID returned from workday's API is actually the Workday ID, not Worker ID. The Workday ID or WID is a direct reference to any object in Workday. This is often referred to as an "Integration ID". Workday doesn't document this very well, but workday's URLs do have an interesting thing you can take advantage of for deep linking to any Workday Object:
https://www.myworkday.com/{myCompany}/d/inst/{sourceReferenceWID}/{WID}.htmld
As long as you have the Workday ID (WID) of an object, you can deeplink directly. The sourceReferenceWID is just for logging purposes, so you can enter any text you want. I tested this in my own tenant with the text "deeplink" replacing {sourceReferenceWID} just for fun. For your example, the following URL should work for Joe Cool:
https://www.myworkday.com/{myCompany}/d/inst/deeplink/deadbeefdeadbeefdeadbeefdeadbeef.htmld
This is not officially documented, so Workday may change how this works and your mileage may vary.
It's not a delivered REST API, but you could create a RaaS with the Business Object "Worker from Prompt". There is a field called "Worker Instance URL". When you call the endpoint, you can use the WID (Workday ID), the Employee_ID, or Contingent_Worker_ID for the filter.
https://wd2-impl-services1.workday.com/ccx/service/customreport2/{tenant}/{report owner}/{report name}?Worker!WID=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
or
https://wd2-impl-services1.workday.com/ccx/service/customreport2/{tenant}/{report owner}/{report name}?Worker!Employee_ID=x

Workday get_worker from USER_ID or email filter

I am trying to find an API to get worker on email basis. Can someone please help me in the same.
No, there is no such way to get worker by email.
You may refer to the api for get workers here -> https://community.workday.com/sites/default/files/file-hosting/productionapi/Human_Resources/v30.1/Get_Workers.html
but you sure can retrieve data using employee_id, using the request xml as follows:-
<wd:Get_Workers_Request xmlns:wd="urn:com.workday/bsvc" version="30.0">
<wd:Request_References bsvc:Skip_Non_Existing_Instances="false">
<wd:Worker_Reference >
<wd:ID wd:type="Enter ID type here...for eg WID,Employee_ID">Enter WID or other ID type you have choosen</wd:ID>
</wd:Worker_Reference>
</wd:Request_References>
</wd:Get_Workers_Request>
No, this isn't possible through the Public APIs.
Your Workday team or Integration Administrator could set up a custom report enabled for REST calls with email address as the prompt, though. The Workers from Prompt data source is good for this.

Counting the number of response codes in JMeter 4.0

I run some load tests (all endpoints) and we do have a known issue in our code: if multiple POST requests are sent in the same time we do get a duplicate error based on a timestamp field in our database.
All I want to do is to count timeouts (based on the message received "Service is not available. Request timeout") in a variable and accept this as a normal behavior (don't fail the tests).
For now I've added a Response Assertion for this (in order to keep the tests running) but I cannot tell if or how many timeout actually happen.
How can I count this?
Thank you
I would recommend doing this as follows:
Add JSR223 Listener to your Test Plan
Put the following code into "Script" area:
if (prev.getResponseDataAsString().contains('Service is not available. Request timeout')) {
prev.setSampleLabel('False negative')
}
That's it, if sampler will contain Service is not available. Request timeout in the response body - JMeter will change its title to False negative.
You can even mark it as passed by adding prev.setSuccessful(false) line to your script. See Apache Groovy - Why and How You Should Use It article fore more information on what else you can do with Groovy in JMeter tests
If you just need to find out the count based on the response message then you can save the performance results in a csv file using simple data writer (configure for csv only) and then filter csv based on the response message to get the required count. Or you can use Display only "errors" option to get all the errors and then filter out based on the expected error message.
If you need to find out at the runtime then you can use aggregate report listener and use "Errors" checkbox to get the count of failure but this will include other failures also.
But, if you need to get the count at the run time to use it later then it is a different case. I am assuming that it is not the case.
Thanks,

Does Import.io api support status of the extractor?

I've just created an extractor with import.io. This extractor uses chaining. Firstly I'm extracting some urls from one page and with these extracted urls, I'm extracting detail pages. When detail pages' extraction finish, I want to get the results. But how can I be sure that extraction is completed. Is there any api endpoint for checking the status of extraction?
I found "GET /store/connector/{id}" endpoint from legacy. But when I try this, I got 404. You can take a look at the screenshot.
Another question is, I want to schedule my extractor twice a day. Is this possible?
Thanks
Associated with each Extractor are Crawl Runs. A crawl run represents the running of an extractor with a specific configuration (training, list of URLs, etc). The state of each of a crawl run can have one of the following values:
STARTED => Currently running
CANCELLED => Started but cancelled by the user
FINISHED => Run was complete
Additional metadata that is included is as follows:
Started At - When the run started
Stopped At - When the run finished
Total URL Count - Total number of URLs in the run
Success URL Count - # of successful URLs queried
Failed URL Count - # of failed URLs queried
Row Count - Total number of rows returned in the run
The REST API to get the list of craw runs associated with an extractor is as follows:
curl -s X GET "https://store.import.io/store/crawlrun/_search?_sort=_meta.creationTimestamp&_page=1&_perPage=30&extractorId=$EXTRACTOR_ID&_apikey=$IMPORT_IO_API_KEY"
where
$EXTRACTOR_ID - Extractor to list crawl runs
$IMPORT_IO_API_KEY - Import.io API from your account