HTTP make a request

Hello everyone.

I want to register a new candidate with SpeedExam API. But I couldn’t do this. I am getting error code 500, 401. Where am I making a mistake? Can you help me?
Thanks for your help.

I am sharing the screenshot below.

That’s API documentation.

This is what I did.

Welcome to the Make community!

If you need further assistance, please provide the following:

  • Link to documentation
  • Output bundle of module #3

Please provide the and output bundles of the modules by running the scenario (or get from the scenario History tab), then click the white speech bubble on the top-right of each module and select “Download input/output bundles”.
Screenshot_2023-10-06_141025

A.

Save each bundle contents in your text editor as a bundle.txt file, and upload it here into this discussion thread.

Uploading them here will look like this:

module-1-input-bundle.txt (12.3 KB)
module-1-output-bundle.txt (12.3 KB)

B.

If you are unable to upload files on this forum, alternatively you can paste the formatted bundles in this manner:

  • Either add three backticks ``` before and after the code, like this:

    ```
    input/output bundle content goes here
    ```

  • Or use the format code button in the editor:
    Screenshot_2023-10-02_191027

Providing the input/output bundles will allow others to replicate what is going on in the scenario even if they do not use the external service.

This will allow others to better assist you. Thanks!

3 Likes

Thank you for your answer.
They are the scenario and the documentation.
I hope it helps more.

https://admin.speedexam.net/help.aspx#about_api

Modul 3 input

[
    {
        "scope": "roundtrip",
        "variables": [
            {
                "name": "tn_vorname",
                "value": "John"
            },
            {
                "name": "tn_nachname",
                "value": "Doe"
            },
            {
                "name": "tn_email",
                "value": "mehmetulga@gmail.com"
            },
            {
                "name": "timestamp",
                "value": 1712299449
            },
            {
                "name": "username",
                "value": "mehmetulga@gmail.com"
            },
            {
                "name": "password",
                "value": "PS-1712299449"
            },
            {
                "name": "groupid",
                "value": "100"
            },
            {
                "name": "isactive",
                "value": true
            },
            {
                "name": "apikey",
                "value": "38A5AFEE-2C77-4D46-B9FC-28BB5A71CAC3"
            },
            {
                "name": "accountid",
                "value": "245-42009075"
            },
            {
                "name": "methodnumber",
                "value": "6"
            },
            {
                "name": "create_candidate_url",
                "value": "https://api.speedexam.net/exams.asmx?Candidatesave"
            }
        ]
    }
]

Modul 3 Output

[
    {
        "tn_vorname": "John",
        "tn_nachname": "Doe",
        "tn_email": "mehmetulga@gmail.com",
        "timestamp": 1712299449,
        "username": "mehmetulga@gmail.com",
        "password": "PS-1712299449",
        "groupid": "100",
        "isactive": true,
        "apikey": "38A5AFEE-2C77-4D46-B9FC-28BB5A71CAC3",
        "accountid": "245-42009075",
        "methodnumber": "6",
        "create_candidate_url": "https://api.speedexam.net/exams.asmx?Candidatesave"
    }
]

Modul 20 input

[
    {
        "ca": null,
        "qs": [
            {
                "name": "firstname",
                "value": "John"
            },
            {
                "name": "lastname",
                "value": "Doe"
            },
            {
                "name": "email",
                "value": "mehmetulga@gmail.com"
            },
            {
                "name": "username",
                "value": "mehmetulga@gmail.com"
            },
            {
                "name": "password",
                "value": "PS-1712299449"
            },
            {
                "name": "groupid",
                "value": "100"
            },
            {
                "name": "isactive",
                "value": "true"
            },
            {
                "name": "privatekey",
                "value": "38A5AFEE-2C77-4D46-B9FC-28BB5A71CAC3"
            }
        ],
        "url": "https://api.speedexam.net/exams.asmx?Candidatesave",
        "data": null,
        "gzip": true,
        "method": "post",
        "headers": [
            {
                "name": "AuthorizationHeaderKey",
                "value": "38A5AFEE-2C77-4D46-B9FC-28BB5A71CAC3"
            },
            {
                "name": "AuthorizationHeaderValue",
                "value": "38A5AFEE-2C77-4D46-B9FC-28BB5A71CAC3:6:245-42009075:1712299449"
            }
        ],
        "timeout": null,
        "useMtls": false,
        "authPass": null,
        "authUser": null,
        "bodyType": "raw",
        "contentType": "application/json",
        "serializeUrl": false,
        "shareCookies": false,
        "parseResponse": false,
        "followRedirect": true,
        "useQuerystring": false,
        "followAllRedirects": false,
        "rejectUnauthorized": true
    }
]

Modul 20 Output

[
    {
        "statusCode": 500,
        "headers": [
            {
                "name": "date",
                "value": "Fri, 05 Apr 2024 06:44:10 GMT"
            },
            {
                "name": "content-type",
                "value": "application/soap+xml; charset=utf-8"
            },
            {
                "name": "content-length",
                "value": "1238"
            },
            {
                "name": "connection",
                "value": "close"
            },
            {
                "name": "cache-control",
                "value": "private"
            },
            {
                "name": "x-aspnet-version",
                "value": "4.0.30319"
            },
            {
                "name": "strict-transport-security",
                "value": "max-age=31536000; includeSubDomains; preload"
            },
            {
                "name": "content-security-policy",
                "value": "default-src 'self' dc.services.visualstudio.com 'unsafe-inline' 'unsafe-eval'; script-src 'self' maps.google.com maps.googleapis.com runexam.oncodecogs.com *.googletagmanager.com *.google-analytics.com *.vo.msecnd.net  'unsafe-inline' 'unsafe-eval'; style-src 'self' fonts.googleapis.com runexam.oncodecogs.com 'unsafe-inline' 'unsafe-eval'; img-src 'self' blob: data: *.gstatic.com maps.googleapis.com maps.google.com 'unsafe-inline' 'unsafe-eval'; font-src 'self' *.gstatic.com 'unsafe-inline' 'unsafe-eval';"
            },
            {
                "name": "x-content-security-policy",
                "value": "default-src 'self' dc.services.visualstudio.com 'unsafe-inline' 'unsafe-eval'; script-src 'self' maps.google.com maps.googleapis.com runexam.oncodecogs.com *.googletagmanager.com *.google-analytics.com *.vo.msecnd.net 'unsafe-inline' 'unsafe-eval'; style-src 'self' fonts.googleapis.com runexam.oncodecogs.com 'unsafe-inline' 'unsafe-eval'; img-src 'self' blob: data: *.gstatic.com maps.googleapis.com maps.google.com 'unsafe-inline' 'unsafe-eval'; font-src 'self' *.gstatic.com 'unsafe-inline' 'unsafe-eval';"
            },
            {
                "name": "x-content-type-options",
                "value": "nosniff"
            },
            {
                "name": "x-frame-options",
                "value": "SAMEORIGIN"
            },
            {
                "name": "referrer-policy",
                "value": "strict-origin"
            },
            {
                "name": "permissions-policy",
                "value": "accelerometer=(), camera=(), geolocation=(), gyroscope=(), magnetometer=(), microphone=(), payment=(), usb=()"
            },
            {
                "name": "x-xss-protection",
                "value": "1; mode=block"
            },
            {
                "name": "x-permitted-cross-domain-policies",
                "value": "none"
            },
            {
                "name": "cf-cache-status",
                "value": "DYNAMIC"
            },
            {
                "name": "report-to",
                "value": "{\"endpoints\":[{\"url\":\"https:\\/\\/a.nel.cloudflare.com\\/report\\/v4?s=a%2BKI8%2FsDobIG6Nm2rUp0g1UIwpOLjAces70MgUUQ4SK9v1A77LDGtDjd%2BSFyhJVDrFGqlqplPFr%2FYofTPvXC826NvRD35xaSNtT1jhKAC8BHG7tLiwJZ0Nws2FS%2ByVJ7%2Bc9d\"}],\"group\":\"cf-nel\",\"max_age\":604800}"
            },
            {
                "name": "nel",
                "value": "{\"success_fraction\":0,\"report_to\":\"cf-nel\",\"max_age\":604800}"
            },
            {
                "name": "server",
                "value": "cloudflare"
            },
            {
                "name": "cf-ray",
                "value": "86f7916a2ecf48c5-LHR"
            },
            {
                "name": "alt-svc",
                "value": "h3=\":443\"; ma=86400"
            }
        ],
        "cookieHeaders": [],
        "data": "<?xml version=\"1.0\" encoding=\"utf-8\"?><soap:Envelope xmlns:soap=\"http://www.w3.org/2003/05/soap-envelope\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\"><soap:Body><soap:Fault><soap:Code><soap:Value>soap:Receiver</soap:Value></soap:Code><soap:Reason><soap:Text xml:lang=\"en\">System.Web.Services.Protocols.SoapException: Server was unable to process request. ---&gt; System.Xml.XmlException: Root element is missing.\r\n   at System.Xml.XmlTextReaderImpl.Throw(Exception e)\r\n   at System.Xml.XmlTextReaderImpl.ParseDocumentContent()\r\n   at System.Web.Services.Protocols.SoapServerProtocol.SoapEnvelopeReader.Read()\r\n   at System.Xml.XmlReader.MoveToContent()\r\n   at System.Web.Services.Protocols.SoapServerProtocolHelper.GetRequestElement()\r\n   at System.Web.Services.Protocols.Soap12ServerProtocolHelper.RouteRequest()\r\n   at System.Web.Services.Protocols.SoapServerProtocol.Initialize()\r\n   at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean&amp; abortProcessing)\r\n   --- End of inner exception stack trace ---</soap:Text></soap:Reason><soap:Detail /></soap:Fault></soap:Body></soap:Envelope>",
        "fileSize": 1238
    }
]

1.

These two looks different, perhaps you have to send the text APIKEY instead of the actual api key?

Screenshot_2024-04-05_140416

2.

Also the method ID is 06

Screenshot_2024-04-05_150452

But you are using 6 in the header

Screenshot_2024-04-05_150438

3.

Also, this API doesn’t accept JSON. They are using SOAP 1.2, which means your body has to be in XML.

<?xml version="1.0" encoding="utf-8"?>
<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
  <soap12:Header>
    <AuthorizationHeader xmlns="http://tempuri.org/">
      <Key>string</Key>
      <Value>string</Value>
    </AuthorizationHeader>
  </soap12:Header>
  <soap12:Body>
    <Candidatesave xmlns="http://tempuri.org/">
      <firstname>string</firstname>
      <lastname>string</lastname>
      <street>string</street>
      <city>string</city>
      <state>string</state>
      <zip>string</zip>
      <country>string</country>
      <phone>string</phone>
      <mobile>string</mobile>
      <email>string</email>
      <username>string</username>
      <password>string</password>
      <groupid>int</groupid>
      <isactive>boolean</isactive>
      <privatekey>string</privatekey>
    </Candidatesave>
  </soap12:Body>
</soap12:Envelope>
2 Likes

How to Create and Call a SOAP Connection

1. Insert SOAP Module

Screenshot_2024-04-05_150449

2. Find the WDSL URL from the documentation

Copy this link:

3. Create Connection and paste WDSL link

4. Select the service you want to call

5. Select the endpoint you want to call

The fields will appear magically because it’s SOAP

1 Like

This is as far as I got.

Now the potential issue might be:

  • the groupId (100) doesn’t exist

  • your account ID is incorrect

  • your api key is incorrect

  • the SOAP Headers are not in the correct format (please ask their support)

1 Like

This is Live API Test.

Using this I add a new candidate.
API key and method number and account ID are correct. Also Group ID is correct.

There’s only one thing different here. “Timestamp” is 5 digits here. The time stamp I created is bigger. Does this make a difference?

Also, how did you access the WDSL link? I couldn’t find it. I took it from your screenshot.

I circled the link in one of the screenshots.

I’m afraid you’ll have to ask their support about this.

1 Like

Hallo,

This is the new API documentation. First you need to create a Token. I tried accordingly, but I still couldn’t do it. I don’t know much about the API.

https://apiv2.speedexam.net/swagger/index.html

After some research, I was able to do it myself.

3 Likes