• Ega Rakesh
  • NEWBIE
  • 0 Points
  • Member since 2014

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

i am trying to upload profile photo from one salesforce org to other salesforce org using Chatter REST API.

in source org the photo is in Document object. for this i am constructing a multi-part request in Apex. but i am getting an error saying
Bad Request and message as "you have sent us an Illegal URL or an improperly formatted request"

this is my code 

document d = [select body from document where name='samplename.jpg'];
  //uploading profile photo to user profile - multipart
  string size = string.valueof(d.body.size());
  req.setHeader('Authorization','OAuth ' + token.access_token);
  req.setHeader('Content-Type','multipart/form-data; boundary=-----------------------------153501500631101');
  req.setHeader('Host','ap1.salesforce.com');
  req.setHeader('Content-Length', size);
  req.setHeader('Accept','application/json');
  req.setMethod('POST'); 
  string endpoint1 = token.instance_url + '/services/data/v26.0/chatter/users/00590000002s0blAAA/photo';
  req.setEndpoint(endPoint1);
  String body = '-----------------------------153501500631101\r\n';
  body = body+ 'Content-Disposition: form-data; name="json"\r\n';
  body = body + 'Content-Type: application/json; charset=UTF-8\r\n\r\n';
  body = body + '{"cropX" : "0","cropY" : "0","cropSize" : "200"}\r\n\r\n';
  body = body + '-----------------------------153501500631101\r\n';
  body = body + 'Content-Disposition: form-data; name="Filedata"; filename="samplename.jpg"\r\n';
  body = body + 'Content-Type: application/octet-stream; charset=ISO-8859-1\r\n\r\n';
  //body = body + 'Content-transfer-encoding: binary\r\n\r\n';
  body = body + '-----------------------------153501500631101--';
  req.setBody(body); 
  res = h.send(req);

am i doing any mistake here . below is the image which contians the request body constructed. plesae help me i am trying to do this from 2 days 

User-added image


Thanks,
Rakesh
Hi all,

i ma working on chatter data migration between salesforce orgs. as part of this i have to migrate feeds with @mentions in it.

i didnt find any way how the methins are stored and how can they be migrated to target salesforce org.

please let me know any one has idea about on this

it is very urgenr for me and any help is really appreciated

Thanks,
Rakesh
Hi,

we have a requirement for Chatter data migration from one production org to other. as part of it i am looking into all objects which we need to migrate.


i am unable to find out how to migrate "Chatter Private Messages" which includes conversations, conversation members and finally messages. 
is it possible to do this if not what will be the other alternative for it. please let me know if anyone worked on such requirement.

we are using informatica powercenter for migration

Thanks,
Rakesh
Hi big audience!
I've developer several components since the release of Lightning framework but I still have a strange problem.
When I load external libraries (most common case is Bootstrap and jQuery) sometimes the jQuery library is not correctly loaded on startup, thus causing problems on dynamically loaded UI.
The docs say I should use the "renderer" with the afterRender event, but doing this I don't see any trace of jQuery (like it is not yet loaded, the $ plugin is undefined), so I can't init my UI from that method.
This leads to random crash of the app on first load, because sometimes the jQUery library is not loaded on startup.
Do you have any suggestions on this?
I'm currently using "setTimeout" to run the UI initializazione asynchronously, but I don't think this is a clean and good solution.
Thanks
Enrico
 
Hi all,

i ma working on chatter data migration between salesforce orgs. as part of this i have to migrate feeds with @mentions in it.

i didnt find any way how the methins are stored and how can they be migrated to target salesforce org.

please let me know any one has idea about on this

it is very urgenr for me and any help is really appreciated

Thanks,
Rakesh