VLT-Website-Heading

How to test the pymetrics Web Services using SOAP UI

Nov 17, 2019 6:52:27 PM / by Vu Long Tran

This guide will explain how you can use SOAP UI Open Source software to run API calls to test the pymetrics Web Services APIs, showing you example API calls so you can view the outputs to expect.

If you are new to SOAP UI and SOAP APIs, then I recommend reading the following posts:

How to use the pymetrics Web Services APIs using SOAP UI

This assumes you have already set up your environment and have connectivity to start testing and engaging with the pymetrics Web Services APIs. If you need help on this part, I wrote a guide in an earlier post where I will guide you on how to add and test your connectivity with pymetrics Web Services API.

Prerequisite - Installed Soap UI Open Source

If you haven't already done so, please download and install the free SoapUI Open Source software on your computer via soapui.org/downloads/soapui.html.

How to use the pymetrics Web Services APIs using SOAP UI

API call 1 - Run Authentication API call

For the Web Services API calls to function, you will need to authenticate yourself and retrieve a session ID.

What you need for this API call to function:

  • Client ID
  • Client Secret

These Client ID and Client Secret login details will be provided to you via secure encrypted email by your pymetrics Solutions Engineer.

What output will you receive from this:

  • Session ID

Note - This session ID will change on an ongoing basis.

Endpoint: https://www.pymetrics.com/docs/integrations/webservice/v2

Here is the request body to send with the API call:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:pym="pym.intg.ws.2.0.0">
<soapenv:Header/>
<soapenv:Body>
<pym:authenticate>
<pym:client_id></pym:client_id>
<pym:session_id></pym:session_id>
</pym:authenticate>
</soapenv:Body>
</soapenv:Envelope>


Run Authentication API call

API call 2 - Request Assessment API

Request Assessment API will be a key API call you will be making. The goal of this API is to provide you with a unique pymetrics assessment link.

Endpoint: https://www.pymetrics.com/docs/integrations/webservice/v2

Here is the request body to send with the API call:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:pym="pym.intg.ws.2.0.0" xmlns:int="integrations.webservice.ws_models">
<soapenv:Header>
<pym:RequestHeader>
<pym:client_id></pym:client_id>
<pym:session_id></pym:session_id>
</pym:RequestHeader>
</soapenv:Header>
<soapenv:Body>
<pym:request_assessment>
<!--Optional:-->
<pym:order>
<int:city>New York</int:city>
<int:first_name></int:first_name>
<int:last_name></int:last_name>
<int:callback_url>https://www.dejavuguides.com/</int:callback_url>
<int:gender>Male</int:gender>
<int:assessment_id>0</int:assessment_id>
<int:application_locale>en</int:application_locale>
<int:country>US</int:country>
<int:external_id></int:external_id>
<int:email>test-email@domain.com</int:email>
</pym:order>
</pym:request_assessment>
</soapenv:Body>
</soapenv:Envelope>


Request Assessment API call example

API call 3 - Run GetBulkStatus API

GetBulkStatus API will allow you to retrieve the current status of your assessment orders. This is useful if you want to know if you have results that you need to pull out from pymetrics’ system into another system but are not too sure about the current status of your assessment order.

Here are example status’ codes you will receive:

Status Meaning
PENDING Request for an assessment has been received, but pymetrics has not approved it.
ACCEPTED Request for an assessment has been received AND approved. Assessment invite URL provided is now usable
NOT_STARTED Candidate has come to pymetrics and created an account but has NOT started the games.
IN_PROGRESS Candidate has started, but has not completed, the assessment.
COMPLETED Candidate has completed the games. Results have not been transferred to requesting partner. Once this status is reached, you should begin polling the GetBulkResults endpoint for assessment results
FULFILLED Results have been transferred to requesting partner.

Here is the request body to send with the API call:

Endpoint: https://www.pymetrics.com/docs/integrations/webservice/v2

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:pym="pym.intg.ws.2.0.0">
<soapenv:Header>
<pym:RequestHeader>
<pym:session_id></pym:session_id>
<pym:client_id></pym:client_id>
</pym:RequestHeader>
</soapenv:Header>
<soapenv:Body>
<pym:get_bulk_status>
<pym:order_ids>
<pym:integer> </pym:integer>
</pym:order_ids>
</pym:get_bulk_status>
</soapenv:Body>
</soapenv:Envelope>

GetBulkStatus API call

API call 4 - Run GetBulkResults API

GetBulkResults API will allow you to retrieve the results of your assessment order/s. You can retrieve more than one assessment order here.

You will only receive a result if there is results there.

Here is the request body to send with the API call:

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:pym="pym.intg.ws.2.0.0">
<soapenv:Header>
<pym:RequestHeader>
<pym:session_id></pym:session_id>
<pym:client_id></pym:client_id>
</pym:RequestHeader>
</soapenv:Header>
<soapenv:Body>
<pym:get_bulk_results>
<pym:order_ids>
<pym:integer></pym:integer>
</pym:order_ids>
</pym:get_bulk_results>
</soapenv:Body>
</soapenv:Envelope>

GetBulkResults API call

API call 5 - Run GetReport API

GetReport API will allow you to retrieve the recruiter’s report for your assessment order. You can retrieve only one recruiter report URL at a time here.

Using the order ID from "Request Assessment", you will make this GetReport API call and receive a URL link to an recruiter's report.

Here is the request body to send with the API call:

Endpoint: https://www.pymetrics.com/docs/integrations/webservice/v2

<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:pym="pym.intg.ws.2.0.0">
<soapenv:Header>
<pym:RequestHeader>
<pym:session_id></pym:session_id>
<pym:client_id></pym:client_id>
</pym:RequestHeader>
</soapenv:Header>
<soapenv:Body>
<pym:get_report>
<pym:order_id></pym:order_id>
</pym:get_report>
</soapenv:Body>
</soapenv:Envelope>


GetReport API call

Enjoy using SOAP UI!

Vu Long Tran

Written by Vu Long Tran

Solutions Engineer APAC @pymetrics . ex-@Forrester consultant. Tweeting on #cloud, #cybersecurity, #equality and #tech tinkering!

    Lists by Topic