API unauthorized access

All AdCenter service calls give me the following error:
"Server was unable to process request. ---> |-400001|-1|API unauthorized access|"

Soap looks like this:
< 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:Header>
        <ns1:ApiUserAuthHeader soapenv:actor="http://schemas.xmlsoap.org/soap/actor/next" soapenv:mustUnderstand="0" xmlns:ns1="http://adcenter.microsoft.com/syncapis">
            <ns1:UserName>XXXX</ns1:UserName>
            <ns1:Password>XXXX</ns1:Password>
            <ns1:UserAccessKey>XXXX</ns1:UserAccessKey>
        </ns1:ApiUserAuthHeader>
    </soapenv:Header>
    <soapenv:Body>
        <GetAccounts xmlns="http://adcenter.microsoft.com/syncapis">
            <APIFlags>0</APIFlags>
        </GetAccounts>
    </soapenv:Body>
</soapenv:Envelope>

Looking at previous posts it seems that this could be due to an incorrect username/password, yet I am able to log into the Web UI without any problems.

I am attempting to use the production API with the production developer token I was given. Any ideas

Thanks,
Bryan




Answer this question

API unauthorized access

  • jazzmy

    My token was incorrect. Everything works now.  Remember kids, if you run into this error double check your login and tokens with MS!

  • qzrlsd

    Actually, before I receive the authorization error I get an Axis exception, which I assume is related:

    "org.apache.axis.ConfigurationException: No service named CustomerManagementSoap is available"

    Did a search on this forum and no results. Anyone know what this means

    Thanks,
    Bryan

    EDIT:  according to this apache wiki org.apache.axis.ConfigurationException is actually "normal" because axis tries the QName first and then the URI on exception ( ! ).   Anyway, I'm still getting the API unauthorized access error.

  • API unauthorized access