INVALID_LOGIN_CREDENTIALS error on NetSuite, but correct credentials

Viewed 7024

I've been trying to use the NetSuite api for sometime using the netsuite gem.

I can login to the website, but when I try to authenticate from the API I get an INVALID_LOGIN_CREDENTIALS error.

This is the payload of the request:

<?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:platformMsgs="urn:messages_2011_1.platform.webservices.netsuite.com" xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:platformCore="urn:core_2011_1.platform.webservices.netsuite.com">
  <env:Header>
    <platformMsgs:passport>
      <platformCore:email>email@email.com</platformCore:email>
      <platformCore:password>--snip--</platformCore:password>
      <platformCore:account>ACCOUNTNO</platformCore:account>
      <platformCore:role type="role" internalId="ROLE"/>
    </platformMsgs:passport>
  </env:Header>
  <env:Body>
    <platformMsgs:get>
      <platformMsgs:baseRef xsi:type="platformCore:RecordRef" internalId="4" type="customer"/>
    </platformMsgs:get>
  </env:Body>
</env:Envelope>

This is the payload of the response:

<?xml version="1.0" encoding="UTF-8"?>
<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <soapenv:Body>
    <soapenv:Fault>
      <faultcode>soapenv:Server.userException</faultcode>
      <faultstring>You have entered an invalid email address or account number. Please try again.</faultstring>
      <detail>
        <platformFaults:invalidCredentialsFault xmlns:platformFaults="urn:faults_2011_1.platform.webservices.netsuite.com">
          <platformFaults:code>INVALID_LOGIN_CREDENTIALS</platformFaults:code>
          <platformFaults:message>You have entered an invalid email address or account number. Please try again.</platformFaults:message>
        </platformFaults:invalidCredentialsFault>
        <ns1:hostname xmlns:ns1="http://xml.apache.org/axis/">sb-partners-java002.svale.netledger.com</ns1:hostname>
      </detail>
    </soapenv:Fault>
  </soapenv:Body>
</soapenv:Envelope>
2 Answers

Another possible cause of this issue is if the password contains + or % characters. Removing these from the password fixed this for me.

Related