• Shivam Kapoor 33
  • NEWBIE
  • 0 Points
  • Member since 2020

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 3
    Replies

Please help me
Snippet code related to named credential
System.debug('objAuthentication'+objAuthentication.Client_s_Username__c);
Http h = new Http();
HttpRequest req = new HttpRequest(); req.setEndpoint('callout:Test/dwsso/oauth2/access_token'); req.setMethod('POST'); req.setBody('grant_type=password&username=tfeldmeier%40pfsweb.com&password={!HTMLENCODE($Credential.Password)}'); string username = ***********'; string password = 'GmmR2fH2S@A7'; req.setHeader('Content-Type', 'application/x-www-form-urlencoded'); Blob headerValue = Blob.valueOf(username + ':' +password); String authHeader = 'BASIC' +Encodingutil.base64encode(headerValue); req.setHeader('Authorization',authHeader); HttpResponse resp = h.send(req); System.debug('response'+resp.getBody());```
please take on look on screenshot as well 

https://i.stack.imgur.com/4CcBt.png

 

It is giving error
response{"error_description":"Client authentication failed","error":"invalid_client"}

I am getting access token from their basic oauth but after that when i am using this under (Sandbox create api) i am getting this error every time
{ "error": "invalid_token", "error_description": "ffHTMdYh47mM0NbphjkCjdL4nYU" }
my basic oauth code in image:

https://i.stack.imgur.com/Laiza.png


my create on-demand sandbox request in image

https://i.stack.imgur.com/D5raz.png

my json body : { "realm": "****", "ttl": 24, "settings": { "ocapi": [ { "client_id": "**********************", "resources": [ { "resource_id": "/", "methods": [ "get", "post", "put", "patch", "delete" ], "read_attributes": "()", "write_attributes": "" } ] } ], "webdav": [ { "client_id": "**************", "permissions": [ { "path": "/cartridges", "operations": [ "read_write" ] }, { "path": "/impex", "operations": [ "read_write" ] } ] } ] } }
please help me...
Please help me I created a page action in pardot so that i can track that page view but it is not working
"https://netrocon.com/how-to-get-the-most-out-of-pardot-page-actions/" is the link that i want to track. Also i am attaching screenshot of "Page action"

https://i.stack.imgur.com/qEpS5.png

----------------
<form action="http://go.pardot.com/l/860113/2020-04-12/3rbz" method="post"><input type="text" name="email" lable="Email"> <input type="submit" > <a href="https://netrocon.com/how-to-get-the-most-out-of-pardot-page-actions/" >here</a><script type="text/javascript"> piAId = '*****'; piCId = '****'; piHostname = 'pi.pardot.com';
(function() { function async_load(){ var s = document.createElement('script'); s.type = 'text/javascript'; s.src = ('https:' == document.location.protocol ? 'https://pi' : 'http://cdn') + '.pardot.com/pd.js'; var c = document.getElementsByTagName('script')[0]; c.parentNode.insertBefore(s, c); } if(window.attachEvent) { window.attachEvent('onload', async_load); } else { window.addEventListener('load', async_load, false); } })(); </script> </form>

Please help me
Snippet code related to named credential
System.debug('objAuthentication'+objAuthentication.Client_s_Username__c);
Http h = new Http();
HttpRequest req = new HttpRequest(); req.setEndpoint('callout:Test/dwsso/oauth2/access_token'); req.setMethod('POST'); req.setBody('grant_type=password&username=tfeldmeier%40pfsweb.com&password={!HTMLENCODE($Credential.Password)}'); string username = ***********'; string password = 'GmmR2fH2S@A7'; req.setHeader('Content-Type', 'application/x-www-form-urlencoded'); Blob headerValue = Blob.valueOf(username + ':' +password); String authHeader = 'BASIC' +Encodingutil.base64encode(headerValue); req.setHeader('Authorization',authHeader); HttpResponse resp = h.send(req); System.debug('response'+resp.getBody());```
please take on look on screenshot as well 

https://i.stack.imgur.com/4CcBt.png

 

It is giving error
response{"error_description":"Client authentication failed","error":"invalid_client"}

I am getting access token from their basic oauth but after that when i am using this under (Sandbox create api) i am getting this error every time
{ "error": "invalid_token", "error_description": "ffHTMdYh47mM0NbphjkCjdL4nYU" }
my basic oauth code in image:

https://i.stack.imgur.com/Laiza.png


my create on-demand sandbox request in image

https://i.stack.imgur.com/D5raz.png

my json body : { "realm": "****", "ttl": 24, "settings": { "ocapi": [ { "client_id": "**********************", "resources": [ { "resource_id": "/", "methods": [ "get", "post", "put", "patch", "delete" ], "read_attributes": "()", "write_attributes": "" } ] } ], "webdav": [ { "client_id": "**************", "permissions": [ { "path": "/cartridges", "operations": [ "read_write" ] }, { "path": "/impex", "operations": [ "read_write" ] } ] } ] } }
please help me...