• Ginto Mathew
  • NEWBIE
  • 30 Points
  • Member since 2014

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 5
    Replies
Hi all,

Just wondering if anyone else is having a problem using Postman and Salesforce together recently?

I have a connected app setup, allowing for API & refresh_token scopes.  And up until about 2-3wks ago, in Postman I was able to get a new Authorzation Code via the 'Get New Access Token' workflow.

I am using the 'Authorization Code' grant-type, instead of 'Password Credentials'.  As trying to test a new REST service that wouldn't have the user credentials provided before hand so we don't have access/desire to handle this information and as such need the user to login via Salesforce login page to return the instance_url parameters/etc

Previously, this would pop-up the Salesforce login page, you enter the relevant credentials and it would then get you the access token/instance_url/etc.

Now all I am getting is a Login page loop...

No error is displayed on Salesforce login page or the Postman console (nothing is added to the console actually).  So it accepts the username/password (which are correct as I use them to login to the org directly) but then re-loads the login page again and again and again... 

If I post the URL into a browser directly, it prompts me to login and then gives me the expected response include the access code/instance_url...  But for some reason in Postman it just seems to loop on the Login page pop-up.

It did work previously on the 'Authorization Code' setup, and using 'Password Credentials' does work, so once again I know the login details are correct....  

I feel I am missing something really simple here!  But I can't seem to figure it out.

Other searches I have done seem to show people having password issues, but I am 100% sure the username/password combo are correct as they work everywhere else (including in Postman if I use the Password Credentials option)
Hi Board. Has anyone had any success completing the Lightning Component Basics - Attributes & Expressions module?   I attempted the challenge using the Trailhead playground. And think what I did is correct. Yet I get the following error... 

"Challenge Not yet complete... here's what's wrong: The Quantity field is not using the correct output component."

Following is the component I have written:

Component Bundle Name : "campingListItem"
<aura:component >
    
    <aura:attribute name="item" type="Camping_Item__c" required="True"/>
    
    <ui:outputText value="{!item.Name}"/>
    <ui:outputCurrency value="{!item.Price__c}"/>
    <ui:outputNumber value="{!item.Quantity__c}"/>
    <ui:outputCheckbox value="{!item.Packed__c}"/>
	
</aura:component>

User-added image

Object schema is :   Name - Text (80),  Packed__c - Checkbox,  Price__c - Currency (16,2), Quantity__c - Number (18,0).

What could I be doing wrong. Any advice?

 
trigger duplicateremove on Account (before insert,before update) {
for(Account acc : Trigger.New){
list<Account> act = [select id,name from account where Name = :acc.name];
if(act.size()>0){
acc.name.adderror('already exiting records');

}


}

}
I am trying to send an Image and some details to external system (REST JSON). I added the image like this mapEmp.put('image',att.body);   It is not working and throwing error  but  If I remove that line ,its working fine with out image.Please  check it let meknow I am missing anything or approch is wrong?

 HttpRequest req = new HttpRequest();
        Attachment att = new Attachment();
       att = [SELECT ID,Body,ContentType FROM Attachment where ContentType='image/jpeg' and ID='00PD000008GcfohMAB' LIMIT 1];
        req.setEndpoint('http://abc');
        req.setMethod('POST');
        String username = 'abc@xxx.org';
        String password = 'password1';
        Blob headerValue = Blob.valueOf(username + ':' + password);
        String authorizationHeader = 'Basic ' + EncodingUtil.base64Encode(headerValue);
        req.setHeader('Authorization', authorizationHeader);      
        req.setHeader('Content-Type', 'multipart/form-data');
        req.setHeader('Content-Type', 'application/json');     
        system.debug('Auth Header: ' + authorizationHeader);
        Map<String,object> mapEmp = new Map<String,object>();
        mapEmp.put('title', title);
        mapEmp.put('authorDisplayName', authorDisplayName);
        mapEmp.put('lastUpdatedDate',publishedDate);
        mapEmp.put('itemId',itemId);
        mapEmp.put('image',att.body);        
        String JSONString = JSON.serialize(mapEmp);       
        req.setBody(JSONString);         
        Http http = new Http();
        HTTPResponse res = http.send(req);
        System.debug('Body ' + res.getBody());
        system.debug('----res'+res);
        if(res.getStatusCode() == 200)
        { 
            system.debug('Authentication success!!!' + res);           
             
        }
        else
        {
            system.debug('Authentication failed!!!' + res + res.getStatusCode());
          
        } 
        return null;
    }
  • April 30, 2015
  • Like
  • 0