function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Francois LefebvreFrancois Lefebvre 

Marketing Cloud: API Permission Failed

Hello,

I am trying to use the SOAP API, authenticating using the newest OAuth 2.0 features (Using the new "enhanced features" installed package), however any SOAP requests I make result in a "Error: API Permission Failed."

I have played around with the package's permission, re-created the packages, on several instances, always with the same results.  The moment I revert back to using a token obtained via the Legacy package the requests work as expected.

Below is an example request/response for a simple request to retrieve data extensions:
 
=========== Request ===========
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://exacttarget.com/wsdl/partnerAPI">
  <SOAP-ENV:Header>
    <SOAP-ENV:fueloauth>ZKCQIyLMVJoSXYIAFuvk3r6a</SOAP-ENV:fueloauth>
  </SOAP-ENV:Header>
  <SOAP-ENV:Body>
    <ns1:RetrieveRequestMsg>
      <ns1:RetrieveRequest>
        <ns1:ObjectType>DataExtension</ns1:ObjectType>
        <ns1:Properties>Name</ns1:Properties>
        <ns1:Properties>CustomerKey</ns1:Properties>
        <ns1:Properties>CategoryID</ns1:Properties>
      </ns1:RetrieveRequest>
    </ns1:RetrieveRequestMsg>
  </SOAP-ENV:Body>
</SOAP-ENV:Envelope>
<?xml version="1.0" encoding="utf-8"?>

=========== Response ===========
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
  <soap:Header>
    <wsa:Action>RetrieveResponse</wsa:Action>
    <wsa:MessageID>urn:uuid:432bc01d-4a73-47b4-961b-470ed5f0a9ff</wsa:MessageID>
    <wsa:RelatesTo>urn:uuid:85e421bf-ce04-4bcf-a86c-7643edb63ea2</wsa:RelatesTo>
    <wsa:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To>
    <wsse:Security>
      <wsu:Timestamp wsu:Id="Timestamp-9e129000-dbc7-4146-9772-edcaf925da47">
        <wsu:Created>2019-03-04T21:02:49Z</wsu:Created>
        <wsu:Expires>2019-03-04T21:07:49Z</wsu:Expires>
      </wsu:Timestamp>
    </wsse:Security>
  </soap:Header>
  <soap:Body>
    <RetrieveResponseMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
      <OverallStatus>Error: API Permission Failed.</OverallStatus>
      <RequestID>a96f0362-7754-4b7f-94c9-988fa314558c</RequestID>
    </RetrieveResponseMsg>
  </soap:Body>
</soap:Envelope>

I have also attached a screenshot showing the configuration of the API component in my package.

User-added image

It seems as though the permissions are not being applied correctly.  Is there any additional steps I might be missing to be able to use OAuth 2.0 with SOAP API requests ?  Any other insights regarding this issue?

Thank you!
Tim GreenwoodTim Greenwood

Hi Francois, 

I had a similar issue going on, what does your POST endpoint look like?

I changed my SOAP BASE URI to end with (soap.marketingcloudapis.com/Service.asmx) and it seemed to get me going.
 

Let me know how you go.

R N 17R N 17
Was anyone able to read DataExtensionObjects via Soap-Partner-API?

Running into the same problem. Can write and update rows to DataExtensions, but can not retrieve them.
The Soaprequest looks like this:

<?xml version="1.0" encoding="utf-8"?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
  <s:Header>
    <Action s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">Retrieve</Action>
    <fueloauth>_token_</fueloauth>
  </s:Header>
  <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <RetrieveRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
      <RetrieveRequest>
        <ObjectType>DataExtensionObject[4C18A720-ECC0-4442-81C6-48989332E2D9]</ObjectType>
        <Properties>Name</Properties>
      </RetrieveRequest>
    </RetrieveRequestMsg>
  </s:Body>
</s:Envelope>

The response is

  <soap:Body>
    <RetrieveResponseMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
      <OverallStatus>Error: API Permission Failed.</OverallStatus>
      <RequestID>2852fa40-a595-48c2-94fa-0559d884b7ae</RequestID>
    </RetrieveResponseMsg>
  </soap:Body>