• Brijesh Vittal
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 4
    Replies
I'm looking at the Case Escalations --- Setup -> Administration Setup -> Monitoring -> Case Escalations --- and several cases are still sitting there, several hours *after* the "Escalate At" time. Does anyone know why they might not be escalating?
It uses Jiujitsu for Authentication. Looking for Service to Service Authentication. 
It is said, It uses HmacSHA256 Algorithm.
The Autherisation header user needs OAuth2 MAC token.

Thanks in advance for any help that comes.
It uses Jiujitsu for Authentication. Looking for Service to Service Authentication. 
It is said, It uses HmacSHA256 Algorithm.
The Autherisation header user needs OAuth2 MAC token.

Thanks in advance for any help that comes.
Good Morning,
Need help in exporting Knowledge Articles from one env to another env.
I tried the out of the box Export Articles for Translation but after first page of picking the Queue, in the second page,
I am not able to pick the languages.. I don't see the option of selecting the languages list.
So, I am getting the ERROR: "Please select source and target language pairs you want to export"

Kind regards

Dhanalakshmi
I am trying to connect to amazon MWS and fetch some report but ever time the API produces the same error  
<Code>SignatureDoesNotMatch</Code>
<Message>The request signature we calculated does not match the signature you provided. Check your AWS Secret Access Key and signing method. Consult the service documentation for details.</Message>

THE CODE
Datetime now = Datetime.now().addDays(1);
    //String timestamp = now.formatGmt('yyyy-MM-dd')+'T'+now.formatGmt('HH:mm:ss')+'.'+now.formatGMT('SS')+'Z';
    String timestamp = now.formatGmt('yyyy-MM-dd')+'T'+now.formatGmt('HH:mm:ss')+'Z';
    DateTime start_dt = DateTime.newInstance(2014, 12, 16,15,21,30);
    DateTime end_dt = DateTime.newInstance(2014, 12, 18,14,17,21);
    //String start_date = start_dt.formatGmt('yyyy-MM-dd')+'T'+start_dt.formatGmt('HH:mm:ss')+'.'+start_dt.formatGMT('SS')+'Z';
    //String end_date = end_dt.formatGmt('yyyy-MM-dd')+'T'+end_dt.formatGmt('HH:mm:ss')+'.'+end_dt.formatGMT('SS')+'Z';
    String start_date = start_dt.formatGmt('yyyy-MM-dd')+'T'+start_dt.formatGmt('HH:mm:ss')+'Z';
    String end_date = end_dt.formatGmt('yyyy-MM-dd')+'T'+end_dt.formatGmt('HH:mm:ss')+'Z';

String request = 'AWSAccessKeyId='+urlencode('-***MY CODE*****-')+
            '&Action='+urlencode('RequestReport') +
            '&ReportType=' + urlencode( '_GET_MERCHANT_LISTINGS_DATA_')  +
            //'&StartDate=' + urlencode(start_date) +
            //'&EndDate=' + urlencode(end_date)+
            '&MWSAuthToken='+urlencode('-**** MY TOKEN******-')+
            //'&Marketplace='+urlencode('***ID***') +
            '&MarketplaceIdList.Id.1='+urlencode('-****ID*****-')+
            '&Merchant='+urlencode('-****ID*****-') +
            '&SignatureMethod='+urlencode('HmacSHA1') +
            '&SignatureVersion='+urlencode('2')+
            '&Timestamp=' + urlencode(timestamp) +                                                                            
            '&Version=' + urlencode('2009-01-01');


String canonical =  'GET'+'\n'+
                      'mws.amazonservices.ca\n'+
                      '/\n'+
                      request;
    String key = '-****KEY****-';
    
    //Signature HmacSHA256
    
    //Blob bsig = Crypto.generateMac('HMacSHA1', Blob.valueOf(canonical), Blob.valueOf(key));
    //Blob  b =Crypto.generateDigest('MD5',bsig );
    //Blob bsig =Crypto.generateDigest('HmacSHA256', Blob.valueOf(canonical), Blob.valueOf(key));
     //Blob bsig = Crypto.encryptWithManagedIV('AES256',  Blob.valueOf(key),Blob.valueOf(canonical));
    
    //String signature = EncodingUtil.base64encode(bsig);
    
        String c = EncodingUtil.base64Encode(Blob.valueOf(canonical));
        String signature ;
        String signingKey = EncodingUtil.base64Encode(Blob.valueOf(key));
        Blob mac = Crypto.generateMac('HMacSHA1', blob.valueof(c),blob.valueof(signingKey)); 
        signature = EncodingUtil.base64Encode(mac);                
        //return macUrl;
  
  
    System.debug('String to sign===>\n' + canonical );
    System.debug('Signature===>\n' + signature );

String body =request+'&Signature=' + urlEncode(signature);
   
   
   System.debug('canonical ===>\n' + canonical);
    System.debug('Body===>\n' + body );
   
   
        HttpRequest req = new HttpRequest();
        HttpResponse res = new HttpResponse();
        Http http = new Http();
        req.setCompressed(true);
        req.setHeader('Content-Type','text/xml');
         req.setHeader('User-Agent','Salesforce');
        req.setEndpoint('https://mws.amazonservices.ca/?'+body);
        req.setMethod('GET');
        //req.setBody(body);
           
           /*req.setHeader('Host','salesforce.com');
           req.setHeader('x-amazon-user-agent','cloud/1.0');*/
      
        res = http.send(req); 
  
   
   system.debug(res.getbody());
   
   
    return null;
    
    
    
    
    }

     private String urlEncode(String rawValue) {
        String value = (rawValue == null) ? '' : rawValue;
        String encoded = null;

        try {
            encoded = EncodingUtil.urlEncode(rawValue, 'UTF-8') 
                .replace('+', '%20')
                .replace('*', '%2A')
                .replace('%7E','~');
        } catch (Exception e) {
            //System.err.println("Unknown encoding: " + CHARACTER_ENCODING);
            //e.printStackTrace();
        }

        return encoded;
    }

I have done every possible altaration on Signing algo,Url encoding as there docs but all were invain...

Hello,

 

I've created a custom clone button for my support analysts to use so that no matter what status their case is in, and no matter what entitlement fields are populated, the newly cloned case will show a status of "New Incident" and all of the entitlement fields will be wiped clean.

 

Here is my code

 

/{!Case.Id}/e?clone=1&retURL=%{!Case.Id}&00N700000022SWB='New Incident'&00N700000028niR=&00N700000028niY=&00N700000028nir=&00N700000028niE=&00N700000028nid=

 The code works nicely.  The problem I am running into now is that if someone click on the button to innitiate the clone, and them the do not save the clone and click cancel instead they get the "URL No Longer Exists" page.  The URL below is what is shown in the address bar...

 

https://cs3.salesforce.com/500/P0Q0000000cwJ9

 

If I just click the back arrow instead of cancel, the browser acts accordingly and goes back to...

 

https://cs3.salesforce.com/500Q0000000cwJ9

 

So, why is the "/P0" getting added when I click cancel, and how can I remedy this.

 

Cheers,

Ward

 

 

 

 

 

  • May 01, 2009
  • Like
  • 0