forcedotcom / postman-salesforce-apis

Salesforce API Postman Collection
Creative Commons Zero v1.0 Universal
1.06k stars 638 forks source link

Question with error #26

Closed ap-coder closed 3 years ago

ap-coder commented 3 years ago

I have been following your instruction on you webcast and love it by the way but ran into a snag i cant seem to figure out the issue can you help.

Using the AUTH> SOAP Login it keeps erroring out with the following.

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sf="urn:fault.partner.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <soapenv:Body>
        <soapenv:Fault>
            <faultcode>UNKNOWN_EXCEPTION</faultcode>
            <faultstring>UNKNOWN_EXCEPTION: The reference to entity &quot;Cl&quot; must end with the &apos;;&apos; delimiter.</faultstring>
            <detail>
                <sf:UnexpectedErrorFault xsi:type="sf:UnexpectedErrorFault">
                    <sf:exceptionCode>UNKNOWN_EXCEPTION</sf:exceptionCode>
                    <sf:exceptionMessage>The reference to entity &quot;Cl&quot; must end with the &apos;;&apos; delimiter.</sf:exceptionMessage>
                </sf:UnexpectedErrorFault>
            </detail>
        </soapenv:Fault>
    </soapenv:Body>
</soapenv:Envelope>

I looked through the files and they seem formatted correctly and have no idea what is doing it.

I also have another question on the other files like in REST > Limit what do i set the endpoint as or with?

Thanks in advance.

scolladon commented 3 years ago

Hi @ap-coder !

Thanks for your kind words and your interest in the Postman Collection. Could you share the environment you are using and related configuration ? Screenshot 2020-09-22 at 11 17 21

Could you also share the content of the code button and choose HTTP please ? Screenshot 2020-09-22 at 11 18 23

It will help us to reproduce and understand the root cause of the issue.

Feel free to obfuscate the username and password value by setting it to wrong random values when providing it please

ap-coder commented 3 years ago

Ok @scolladon as requested here you go.
I was using your SOAP Login template.

Environment

{
"id": "4a7ae720-7e3f-4c7d-8afc-c5be2adca313",
"name": "CODE",
"values": [
{
"key": "url",
"value": "https://test.salesforce.com",
"enabled": true
},
{
"key": "version",
"value": "48.0",
"enabled": true
},
{
"key": "username",
"value": "api@example.com",
"enabled": true
},
{
"key": "password",
"value": "example",
"enabled": true
},
{
"key": "secretToken",
"value": "secret1EGVPuYQz0UKyIMg29u",
"enabled": true
},
{
"key": "clientId",
"value": "3MVG9Km_cBLhsuPzr.MCJpTG0KZGn9vUJgPZSd87rwNuF5kdUVvvE5K8ZL_6T0sZo2L1YgH_VDrIyPkvdv4F5",
"enabled": true
},
{
"key": "clientSecret",
"value": "D279BFAB0BCC1B0EFEA4343FA533E79C061C2FF8A364DF11CA378FFAF74A4101",
"enabled": true
},
{
"key": "redirectUrl",
"value": "",
"enabled": true
},
{
"key": "initAccessToken",
"value": "",
"enabled": true
},
{
"key": "site",
"value": "",
"enabled": true
}
],
"_postman_variable_scope": "environment",
"_postman_exported_at": "2020-09-23T16:25:10.741Z",
"_postman_exported_using": "Postman/7.33.0"
}

Generated code for HTTP

POST /services/Soap/u/48.0 HTTP/1.1
Host: https://test.salesforce.com
Content-Type: text/xml
SOAPAction: login
charset: UTF-8

<?xml version="1.0" encoding="utf-8" ?>
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
  <env:Body>
    <n1:login xmlns:n1="urn:partner.soap.sforce.com">
      <n1:username>api@example.com</n1:username>
      <n1:password>examplesecret1EGVPuYQz0UKyIMg29u</n1:password>
    </n1:login>
  </env:Body>
</env:Envelope>

Let me know if you need anything else.

ap-coder commented 3 years ago

@scolladon another question do you have a example/template on a way to create a case / web to case record but through the api somehow. Something other then using the webtocase generated html. Of if there is no other way i understand but am curious.

scolladon commented 3 years ago

@ap-coder the payload seems fine. You even have added the secret token. It is working fine on my side. Do you have a my domain ? Could you try to put the my domain in the url variable ?

To answer your question you can use the endpoint REST/SObject Create. Copy it in another collection and change the last part of the url to Case. Fill the body with the fields you need and execute the call. Let us know if it worked

pozil commented 3 years ago

Closing after inactivity. Please reopen the issue or comment if the issue is still valid.