on 2023 Jan 30 11:43 AM
Hi, experts.
I want to retrieve Employee data using Compound Employee API but it's not worked.
I've read the SAP document of Employee Central Compound Employee API, then I send API call as written in the document.
However the response was not what I expected.
If you have any ideas to resolve this issue, plz let me know.
Any answer would be helped.
Thank you.
The request was like this;
<query>
<queryString>
SELECT person, personal_information, employment_information,
job_information
FROM CompoundEmployee
WHERE last_modified_date >= to_date('2022-01-01','YYYY-MM-DD')
</queryString>
<param>
<name>maxRows</name>
<value>50</value>
</paramY
</query>
The response was like this;
[
{
"wsdl:definitions": {
"wsdl:types": {
"schema": [
{
"complexType": {
"sequence": {
"element": [
{
"@name": "errorCode",
"@type": "xsd:string"
},
{
"@name": "errorMessage",
"@type": "xsd:string"
}
]
},
"@name": "SFWebServiceFaultException"
},
"element": {
"@name": "SFWebServiceFault",
"@type": "fns:SFWebServiceFaultException"
},
"@elementFormDefault": "qualified",
"@targetNamespace": "urn:fault.sfapi.successfactors.com"
},
{
"import": {
"@namespace": "urn:fault.sfapi.successfactors.com"
},
"simpleType": [
{
"restriction": {
"enumeration": [
{
"@value": "insert"
},
{
"@value": "update"
},
{
"@value": "upsert"
},
{
"@value": "delete"
},
{
"@value": "query"
},
{
"@value": "queryMore"
}
],
"@base": "xsd:string"
},
"@name": "featureType"
},
{
"restriction": {
"enumeration": [
{
"@value": "string"
},
{
"@value": "date"
},
{
"@value": "datetime"
},
{
"@value": "int"
},
{
"@value": "long"
},
{
"@value": "float"
},
{
"@value": "double"
},
{
"@value": "boolean"
},
{
"@value": "binary"
}
],
"@base": "xsd:string"
},
"@name": "dataType"
}
],
"complexType": [
{
"sequence": {
"element": [
{
"@name": "companyId",
"@type": "xsd:string"
},
{
"@name": "username",
"@type": "xsd:string"
},
{
"@name": "password",
"@type": "xsd:string"
},
{
"@name": "developerKey",
"@type": "xsd:string",
"@minOccurs": 0,
"@maxOccurs": 1
}
]
},
"@name": "SFCredential"
},
Request clarification before answering.
Hey, i was in the same issue, solved with this SOAP request:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:sfobject.sfapi.successfactors.com">
<soapenv:Header/>
<soapenv:Body>
<urn:query>
<urn:queryString><![CDATA[SELECT person,identity_information,personal_information,address_information,phone_information,email_information,person_relation,employment_information,job_information,job_relation,national_id_card,dependent_information,personal_documents_information FROM CompoundEmployee WHERE LAST_MODIFIED_ON > to_datetime('2024-06-01T00:00:00Z')]]></urn:queryString>
<!--Zero or more repetitions:-->
<urn:param>
<urn:name>maxRows</urn:name>
<urn:value>${property.lv_maxRows}</urn:value>
</urn:param>
<urn:param>
<urn:name>query mode</urn:name>
<urn:value>delta</urn:value>
</urn:param>
</urn:query>
</soapenv:Body>
</soapenv:Envelope>
and, yes, you must get a session id before:
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:sfobject.sfapi.successfactors.com">
<soapenv:Header/>
<soapenv:Body>
<urn:login>
<urn:credential>
<urn:companyId>${property.lv_SFEC_Company}</urn:companyId>
<urn:username>${property.lvUsername}</urn:username>
<urn:password>${property.lvPassword}</urn:password>
</urn:credential>
<!--Zero or more repetitions:-->
</urn:login>
</soapenv:Body>
</soapenv:Envelope>
Regards
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, jasperdegroot
I send login request to SFAPI, but API response the error.
The request I send like this
POST<https://apixx.successfactors.com/sfapi/v1/soap><http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn: sfobject.sfapi.successfactors.com">and the error message is here
{
"errorCode": "2108",
"message": "{\"fault\":{\"faultstring\":\"Failed to execute the ExtractVariables: ExtractCompanyId\",\"detail\":{\"errorcode\":\"steps.extractvariables.ExecutionFailed\"}}}",
"failureType": "UserError",
"target": "Web2",
"details": []
}
I was able to log in on the website.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
jasper.de.groot - we are running into the same error trying to perform a login process. Same error message related to companyId and ours is definitely noted correctly. Is this error code really specific to the attribute or are there other sources of error to troubleshoot? Working in Postman for now.
Regards,
Henrik
Sure, you have to use the login tab, that should create a request like this (you need to replace the capitalized words with details from your SuccessFactors system (the link could look something like this: https://api55preview.sapsf.eu/sfapi/v1/soap) :
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:sfobject.sfapi.successfactors.com">
<soapenv:Header/>
<soapenv:Body>
<urn:login>
<urn:credential>
<urn:companyId>NAME</urn:companyId>
<urn:username>USER</urn:username>
<urn:password>PASSWORD</urn:password>
<!--Optional:-->
<urn:developerKey>?</urn:developerKey>
</urn:credential>
<!--Zero or more repetitions:-->
<urn:param>
<urn:name>?</urn:name>
<urn:value>?</urn:value>
</urn:param>
</urn:login>
</soapenv:Body>
</soapenv:Envelope>
Please have a look at this blog too: Connecting Successfactors APIs Using SOAP UI | SAP Blogs
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It looks like that it can't understand what you request due to the format.
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">
<soap:Body>
<urn:query xmlns:urn="urn:sfobject.sfapi.successfactors.com">
<urn:queryString>
SELECT person, personal_information employment_information, job_information
FROM CompoundEmployee WHERE
last_modified_on > to_datetime('2022-01-01T01:00:00Z')
</urn:queryString>
<urn:param>
<urn:name>queryMode</urn:name>
<urn:value>delta</urn:value>
</urn:param>
<urn:param>
<urn:name>resultOptions</urn:name>
<urn:value>configuredFieldsOnly,renderPreviousTags</urn:value>
</urn:param>
</urn:query>
</soap:Body>
</soap:Envelope>
If you use SOAP UI, don't forget that you must first do the logon request to get the JSESSIONID, which is a hard requirement in the header to do the call.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, jasper.de.groot
Thank you for your answer.
I am just a IT beginner and don't speak English very well, so SOAP API is too difficult for me.
I have a question for you.
I'm now using SOAP UI(Azure Synapse Analytics) so, as you said, I have to get the JSESSIONID.
However I have no idea how to get it. Could you tell me a sample code please?
Thank you.
User | Count |
---|---|
15 | |
10 | |
8 | |
5 | |
3 | |
2 | |
1 | |
1 | |
1 | |
1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.