• Kiran Naidu 7
  • NEWBIE
  • 0 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 2
    Replies
Hello All,

Platform Event Delivery to Lightning Component  is reaching limits, just wanted to know if anyone can help me to understand below?

1.How to access the event bus to get the list events failed in Delivery?
2.How long these failed event delivery are persist in the Event Bus?
3. Are those failed event deliveries can get's released on the next start of the Day?
4. Are there any design alternatives to avoid Event Delivery to LWC?

Thank you.


 

Kiran Naidu 7 
NetSuite oauth1.0 - oauth_signature_method= hmac-sha256
Hi All,
I am trying to integrate salesforce with Netsuite using Oauth 1.0 with oauth_signature_method= hmac-sha256 
I have the below code and trying to Get the Customer details

String nonce = String.valueOf(Crypto.getRandomLong());
String tnow = String.valueOf(DateTime.now().getTime()/1000);
String baseString = '7156829&ecbb91e9da54d2fb032284c475a19359ab93bf7f4f9397ee0f88de66c8408e7f&b8410d1e3f16268240a7627f26b60b54c8e089109340ffaf892ba916ca2c1b93&'+nonce+'&'+tnow+'';
system.debug('baseString'+ baseString);
String consumerSecret = '4ed07ff01980f0aa7afaaabba0d754769206ababb3e6155cf4908b7c3784caba';
String tokenSecret = '9f0c2fd6348a851dc1054f243da4883b9588c6724a4a65f0999c008bcd09dd5c';
String signingkey = consumerSecret+'&'+tokenSecret;
system.debug('signingkey'+ signingkey);
//Blob sig = Crypto.generateMac('hmacSHA256', Blob.valueOf(baseString), Blob.valueOf(consumerSecret+'&'+(tokenSecret!=null ? tokenSecret : '')));
Blob sig = Crypto.generateMac('hmacSHA256', Blob.valueOf(baseString), Blob.valueOf(signingkey));
String signature = EncodingUtil.urlEncode(EncodingUtil.base64encode(sig), 'UTF-8');
system.debug('sig'+ sig);        
System.debug('Signature: '+signature);
            Http http = new Http();
            HttpRequest request = new HttpRequest();
            String AuthString = 'OAuth realm=XXXXXXX", oauth_consumer_key="ecbb91e9da54d2fb032284c475a19359ab93bf7f4f9397ee0f88de66c8408e7f", oauth_token="b8410d1e3f16268240a7627f26b60b54c8e089109340ffaf892ba916ca2c1b93", oauth_signature_method="HMAC-SHA256", oauth_timestamp="'+tnow+'", oauth_nonce="'+nonce+'", oauth_version="1.0", oauth_signature="'+signature+'"';
            System.debug('Authorization: '+AuthString);
            request.setEndpoint('https://xxxxxx.suitetalk.api.netsuite.com/services/rest/record/v1/customer/7');
            request.setMethod('GET');
            request.setHeader('Authorization', AuthString);
            //request.setHeader('Content-Type', 'application/x-www-form-urlencoded');
            HttpResponse response = http.send(request);
            System.debug(response.getBody());


but I get below Error

{"type":"https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.2","title":"Unauthorized","status":401,"o:errorDetails":[{"detail":"Invalid login attempt.","o:errorCode":"INVALID_LOGIN_ATTEMPT"}]}

I verified Audit log in NetSuite and I see "Invalid Signature"

Can anyone help/suggest me to fix this issue.
Hi All,
I am trying to integrate salesforce with Netsuite using Oauth 1.0 with oauth_signature_method= hmac-sha256 
I have the below code and trying to Get the Customer details

String nonce = String.valueOf(Crypto.getRandomLong());
String tnow = String.valueOf(DateTime.now().getTime()/1000);
String baseString = '7156829&ecbb91e9da54d2fb032284c475a19359ab93bf7f4f9397ee0f88de66c8408e7f&b8410d1e3f16268240a7627f26b60b54c8e089109340ffaf892ba916ca2c1b93&'+nonce+'&'+tnow+'';
system.debug('baseString'+ baseString);
String consumerSecret = '4ed07ff01980f0aa7afaaabba0d754769206ababb3e6155cf4908b7c3784caba';
String tokenSecret = '9f0c2fd6348a851dc1054f243da4883b9588c6724a4a65f0999c008bcd09dd5c';
String signingkey = consumerSecret+'&'+tokenSecret;
system.debug('signingkey'+ signingkey);
//Blob sig = Crypto.generateMac('hmacSHA256', Blob.valueOf(baseString), Blob.valueOf(consumerSecret+'&'+(tokenSecret!=null ? tokenSecret : '')));
Blob sig = Crypto.generateMac('hmacSHA256', Blob.valueOf(baseString), Blob.valueOf(signingkey));
String signature = EncodingUtil.urlEncode(EncodingUtil.base64encode(sig), 'UTF-8');
system.debug('sig'+ sig);        
System.debug('Signature: '+signature);
            Http http = new Http();
            HttpRequest request = new HttpRequest();
            String AuthString = 'OAuth realm=XXXXXXX", oauth_consumer_key="ecbb91e9da54d2fb032284c475a19359ab93bf7f4f9397ee0f88de66c8408e7f", oauth_token="b8410d1e3f16268240a7627f26b60b54c8e089109340ffaf892ba916ca2c1b93", oauth_signature_method="HMAC-SHA256", oauth_timestamp="'+tnow+'", oauth_nonce="'+nonce+'", oauth_version="1.0", oauth_signature="'+signature+'"';
            System.debug('Authorization: '+AuthString);
            request.setEndpoint('https://xxxxxx.suitetalk.api.netsuite.com/services/rest/record/v1/customer/7');
            request.setMethod('GET');
            request.setHeader('Authorization', AuthString);
            //request.setHeader('Content-Type', 'application/x-www-form-urlencoded');
            HttpResponse response = http.send(request);
            System.debug(response.getBody());


but I get below Error

{"type":"https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.2","title":"Unauthorized","status":401,"o:errorDetails":[{"detail":"Invalid login attempt.","o:errorCode":"INVALID_LOGIN_ATTEMPT"}]}

I verified Audit log in NetSuite and I see "Invalid Signature"

Can anyone help/suggest me to fix this issue.
Hi All,
I am trying to integrate salesforce with Netsuite using Oauth 1.0 with oauth_signature_method= hmac-sha256 
I have the below code and trying to Get the Customer details

String nonce = String.valueOf(Crypto.getRandomLong());
String tnow = String.valueOf(DateTime.now().getTime()/1000);
String baseString = '7156829&ecbb91e9da54d2fb032284c475a19359ab93bf7f4f9397ee0f88de66c8408e7f&b8410d1e3f16268240a7627f26b60b54c8e089109340ffaf892ba916ca2c1b93&'+nonce+'&'+tnow+'';
system.debug('baseString'+ baseString);
String consumerSecret = '4ed07ff01980f0aa7afaaabba0d754769206ababb3e6155cf4908b7c3784caba';
String tokenSecret = '9f0c2fd6348a851dc1054f243da4883b9588c6724a4a65f0999c008bcd09dd5c';
String signingkey = consumerSecret+'&'+tokenSecret;
system.debug('signingkey'+ signingkey);
//Blob sig = Crypto.generateMac('hmacSHA256', Blob.valueOf(baseString), Blob.valueOf(consumerSecret+'&'+(tokenSecret!=null ? tokenSecret : '')));
Blob sig = Crypto.generateMac('hmacSHA256', Blob.valueOf(baseString), Blob.valueOf(signingkey));
String signature = EncodingUtil.urlEncode(EncodingUtil.base64encode(sig), 'UTF-8');
system.debug('sig'+ sig);        
System.debug('Signature: '+signature);
            Http http = new Http();
            HttpRequest request = new HttpRequest();
            String AuthString = 'OAuth realm=XXXXXXX", oauth_consumer_key="ecbb91e9da54d2fb032284c475a19359ab93bf7f4f9397ee0f88de66c8408e7f", oauth_token="b8410d1e3f16268240a7627f26b60b54c8e089109340ffaf892ba916ca2c1b93", oauth_signature_method="HMAC-SHA256", oauth_timestamp="'+tnow+'", oauth_nonce="'+nonce+'", oauth_version="1.0", oauth_signature="'+signature+'"';
            System.debug('Authorization: '+AuthString);
            request.setEndpoint('https://xxxxxx.suitetalk.api.netsuite.com/services/rest/record/v1/customer/7');
            request.setMethod('GET');
            request.setHeader('Authorization', AuthString);
            //request.setHeader('Content-Type', 'application/x-www-form-urlencoded');
            HttpResponse response = http.send(request);
            System.debug(response.getBody());


but I get below Error

{"type":"https://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html#sec10.4.2","title":"Unauthorized","status":401,"o:errorDetails":[{"detail":"Invalid login attempt.","o:errorCode":"INVALID_LOGIN_ATTEMPT"}]}

I verified Audit log in NetSuite and I see "Invalid Signature"

Can anyone help/suggest me to fix this issue.