0

I am trying to update a DE in Marketing Cloud using the below CURL request but keep getting "403 - Forbidden: Access is denied." Can someone please help and advise why might be the issue here?

    $ curl --location --request POST 'https://xxxxxxxx.auth.marketingcloudapis.com/v2/token' \
> --header 'Content-Type: application/json' \
> --data-raw '{
> "client_id": "xxxxxxxxx",
> "client_secret": "xxxxxxxxxxxxx",
> "grant_type": "client_credentials"
> }'
{"access_token":"eyJhbGciOiJIUzI1NiIsImtpZCI6IjEiLCJ2ZXIiOiIxIiwidHlwIjoiSldUIn0.eyJhY2Nlc3NfdG9rZW4iOiI2VU1YV3gxUFRKNU1Mc2hVdFBoZU1VRFgiLCJjbGllbnRfaWQiOiI5ODBuYXloMDVzdzI2emZ1ZjBuaXE5MjAiLCJlaWQiOjYyMzIxMTYsInN0YWNrX2tleSI6IlM2IiwicGxhdGZvcm1fdmVyc2lvbiI6MiwiY2xpZW50X3R5cGUiOiJTZXJ2ZXJUb1NlcnZlciJ9.nv6qlHnSQ6HSgY6QRQWAq3qcDy-1X3IFGhpAd0s52cw.ROxT-mii2GgEsj36q-oPceQ9g2lCVBb8HeR6miCzlMTAPdACU4HI1RbPoyhgsP0tZywygvlfmvDWV92DKD5HUR15OW0ZDB5jda5Sc7Dum2zmTDLzgBHKYKPgLPujRK3Yh1IK53aPE1oOzw1LDSc_57twndsMVNEMrtnKOeAivzAAeute5LT2Vjn","token_type":"Bearer","expires_in":1079,"scope":"offline email_read email_write data_extensions_read data_extensions_write","soap_instance_url":"https://xxxxxxx.soap.marketingcloudapis.com/","rest_instance_url":"https://xxxxxxx.rest.marketingcloudapis.com/"}

$ curl --location --request GET 'https://mcbvxp9t9b2h6z7mj46r434qcjj0.soap.marketingcloudapis.com/' \
> --header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsImtpZCI6IjEiLCJ2ZXIiOiIxIiwidHlwIjoiSldUIn0.eyJhY2Nlc3NfdG9rZW4iOiI2VU1YV3gxUFRKNU1Mc2hVdFBoZU1VRFgiLCJjbGllbnRfaWQiOiI5ODBuYXloMDVzdzI2emZ1ZjBuaXE5MjAiLCJlaWQiOjYyMzIxMTYsInN0YWNrX2tleSI6IlM2IiwicGxhdGZvcm1fdmVyc2lvbiI6MiwiY2xpZW50X3R5cGUiOiJTZXJ2ZXJUb1NlcnZlciJ9.nv6qlHnSQ6HSgY6QRQWAq3qcDy-1X3IFGhpAd0s52cw.ROxT-mii2GgEsj36q-oPceQ9g2lCVBb8HeR6miCzlMTAPdACU4HI1RbPoyhgsP0tZywygvlfmvDWV92DKD5HUR15OW0ZDB5jda5Sc7Dum2zmTDLzgBHKYKPgLPujRK3Yh1IK53aPE1oOzw1LDSc_57twndsMVNEMrtnKOeAivzAAeute5LT2Vjn' \
> --header 'Content-Type: application/xml' \
> --data-raw '<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:encodingStyle="http://www.w3.org/2003/05/soap-encoding">
> 
> <soap:Header>
> <fueloauth>eyJhbGciOiJIUzI1NiIsImtpZCI6IjEiLCJ2ZXIiOiIxIiwidHlwIjoiSldUIn0.eyJhY2Nlc3NfdG9rZW4iOiI2VU1YV3gxUFRKNU1Mc2hVdFBoZU1VRFgiLCJjbGllbnRfaWQiOiI5ODBuYXloMDVzdzI2emZ1ZjBuaXE5MjAiLCJlaWQiOjYyMzIxMTYsInN0YWNrX2tleSI6IlM2IiwicGxhdGZvcm1fdmVyc2lvbiI6MiwiY2xpZW50X3R5cGUiOiJTZXJ2ZXJUb1NlcnZlciJ9.nv6qlHnSQ6HSgY6QRQWAq3qcDy-1X3IFGhpAd0s52cw.ROxT-mii2GgEsj36q-oPceQ9g2lCVBb8HeR6miCzlMTAPdACU4HI1RbPoyhgsP0tZywygvlfmvDWV92DKD5HUR15OW0ZDB5jda5Sc7Dum2zmTDLzgBHKYKPgLPujRK3Yh1IK53aPE1oOzw1LDSc_57twndsMVNEMrtnKOeAivzAAeute5LT2Vjn</fueloauth>
> </soap:Header>
> 
> <soap:Body>
> <CreateRequest xmlns="https://xxxxxxxxxxxxxxxxxxxx.soap.marketingcloudapis.com/">
> <Options/>
> <Objects xsi:type="DataExtensionObject">
>       <PartnerKey xsi:nil="true"/>
>       <ObjectID xsi:nil="true"/>
>       <CustomerKey>xxxxxx Prize Draw</CustomerKey>
>       <Properties>
>       <Property>
>       <Name>FirstName</Name>
>       <Value>Testing</Value>
>       </Property>
>       <Property>
>       <Name>LastName</Name>
>       <Value>Testing Lname</Value>
>       </Property>
>       <Property>
>       <Name>Email</Name>
>       <Value>xxxxx@gmail.com</Value>
>       </Property>
>       <Property>
>       <Name>Promo Code 1</Name>
>       <Value>TESTpromocode</Value>
>       </Property>
>       </Properties>
> </Objects>
> </CreateRequest>
> 
>   <soap:Fault>
>   </soap:Fault>
> </soap:Body>
> 
> </soap:Envelope>'
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<title>403 - Forbidden: Access is denied.</title>
<style type="text/css">
<!--
body{margin:0;font-size:.7em;font-family:Verdana, Arial, Helvetica, sans-serif;background:#EEEEEE;}
fieldset{padding:0 15px 10px 15px;} 
h1{font-size:2.4em;margin:0;color:#FFF;}
h2{font-size:1.7em;margin:0;color:#CC0000;} 
h3{font-size:1.2em;margin:10px 0 0 0;color:#000000;} 
#header{width:96%;margin:0 0 0 0;padding:6px 2% 6px 2%;font-family:"trebuchet MS", Verdana, sans-serif;color:#FFF;
background-color:#555555;}
#content{margin:0 0 0 2%;position:relative;}
.content-container{background:#FFF;width:96%;margin-top:8px;padding:10px;position:relative;}
-->
</style>
</head>
<body>
<div id="header"><h1>Server Error</h1></div>
<div id="content">
 <div class="content-container"><fieldset>
  <h2>403 - Forbidden: Access is denied.</h2>
  <h3>You do not have permission to view this directory or page using the credentials that you supplied.</h3>
 </fieldset></div>
</div>
</body>
</html>
4
  • It looks like you're making a GET, rather than a POST, you don't have a SoapAction header ("Create") and the soap endpoint would be at {{SoapEndpoint}}/Service.asmx.
    – Macca
    Jun 1, 2020 at 7:28
  • @Macca, thanks for your reply. The POST and SOAP endpoint makes sense but what exactly do you mean by the SoapAction header ("Create")? Where and how am i supposed to add this bit? Please kindly advise. Thanks
    – gds945
    Jun 1, 2020 at 9:03
  • Please find the simple implementation with SoapAction:Retrieve header.... gortonington.com/… by Gortonington Jun 1, 2020 at 10:34
  • thanks @Macca, it is working now as expected, thanks for your help.
    – gds945
    Jun 2, 2020 at 4:46

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.