SOAP – Example of a Write Request
FollowIn this example, we assume you want to insert or update a résumé (CV).
Create the edit view
- Create a form-type view that uses Curricula as the reference table
- Edit the view, assign a tag name such as Curriculum.Edit.API, and add the fields you want to modify
- Expose the view as an API
Create a token to use the APIs
- Create a user. This is the user the API will use to access the platform
- Assign permissions to the user. Grant read and write permissions on Curricula
- Create an API token for your user (you can also use an existing user: obviously the permissions will match those of the chosen user. So if you choose an Administrator, the API key will give the application access to all platform data).
- From a client suitable for consuming the API, use the previously generated URL, replacing API_KEY with the obtained key
- Configure the client using the service definition in WSDL format. All views exposed as APIs are API methods accessible through a single URL.
SOAP message structure
Below are the elements included in the message:
- <soap:APIKey>: contains the API key.
-
<soap:Data>: container of the elements that identify the individual fields of the view. Each field in the exposed view corresponds to an XML element. Each must be filled with the value to be transmitted.
Example:
<soap:Punches.Date>2018-07-31T00:00:00</soap:Punches.Date>Leaving the element empty clears the field on the platform. Omitting the element makes no change to the corresponding field.
Some elements correspond to free-text fields, while others map to fields with a predefined list of values (codifications). The values entered must match the available codification values present on the platform.
To retrieve the list of codifications and their items, specific API methods are available (Lists and ListItems).
-
<soap:Operation>: set the value to
Upsert.
-
<soap:Keys>: represents the tag name(s) of the primary key, i.e., the field used to filter and uniquely extract the résumé to be modified.
In our case, if we want to modify a specific CV we can set the key to the CVID or the fiscal code, or both.
<soap:Keys>CV.CVID</soap:Keys> <soap:Keys>CV.FiscalCode</soap:Keys>Note: The value of this key—i.e., the value of the CVID or fiscal code—must be provided in the previously mentioned Data section.
If the keys element is not specified, or the value passed in the Data section does not match any résumé on the platform, a new record will always be created.
-
<soap:KeysSecondary>: represents the secondary key, used to link the record being imported to another element already present on the platform. For example, in the case of importing a punch (time entry), the secondary key links the punch to the employee who made it, so you can use the fiscal code:
<soap:KeysSecondary>CV.FiscalCode</soap:KeysSecondary>
Comments
0 comments
Please sign in to leave a comment.