Created
July 11, 2022 15:32
-
-
Save swalke16/a9575491cadc2c88897d6ada6384ac22 to your computer and use it in GitHub Desktop.
Workday credential verification
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
import json | |
from xmltodict import parse | |
# Populate these with your Workday info! | |
tenant_name = "" | |
username = f"ISU_USERNAME@{tenant_name}" | |
password = "" | |
# Exact URL may vary | |
url = f"https://services1.myworkday.com/ccx/service/{tenant_name}/Human_Resources/v38.2" | |
page_number = 1 | |
request_body = f"""<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:bsvc="urn:com.workday/bsvc"> | |
<soapenv:Header> | |
<wsse:Security soapenv:mustUnderstand="1" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd"> | |
<wsse:UsernameToken> | |
<wsse:Username>{username}</wsse:Username> | |
<wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordText">{password}</wsse:Password> | |
</wsse:UsernameToken> | |
</wsse:Security> | |
</soapenv:Header> | |
<soapenv:Body> | |
<bsvc:Get_Workers_Request> | |
<bsvc:Response_Filter> | |
<bsvc:Page>{page_number}</bsvc:Page> | |
</bsvc:Response_Filter> | |
</bsvc:Get_Workers_Request> | |
</soapenv:Body> | |
</soapenv:Envelope>""" | |
response = requests.request(method="POST", url=url, data=request_body) | |
print(response.text) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment