In the below code, If I print the String variable report, I am able to get only half of the string that is 123 characters, while the external person is actually passing me a string that contains around 270charatcters+ So I need help to resolve this issue...

Thank you

global class GetAppointment {

    global static String GetAppointment(){
        //get parameters from API consumer
        String report= RestContext.request.params.get('report');

So externally in my Python code, I am trying to hit the above end point by passing a parameter known as reportURL(its a String) where


  • can you add what is he sending or the structure of data and what are you receiving?
    – User6670
    Commented Sep 6, 2019 at 6:10
  • You've verified that the HTTP request contains the full string value? Have you tested with Postman or curl using strings of 125 or 130 length? Is it always cut off at 123 characters? Commented Sep 6, 2019 at 15:10
  • Yes I have tested with the postman also and it is always cutting it off at 123characters only.
    – Jayanth G
    Commented Sep 6, 2019 at 15:41

2 Answers 2


There are several & characters in the string, so they are being parsed as separate parameters. If you can't change the way the external app encodes the string, you'll have to get the separate parameters and rebuild the string.

String report = RestContext.request.params.get('report');
String param1 = RestContext.request.params.get('_nc_oc');
String param2 = RestContext.request.params.get('_nc_ht');
String fullParam = report + param1 + param2;
  • Yes, this might be it...
    – Jayanth G
    Commented Sep 9, 2019 at 8:57
  • Thanks a lot, you were totally right, it was exactly getting stopped at '&', so I asked the external person to encode it and then send it. After the encoding, it's absolutely working fine.
    – Jayanth G
    Commented Sep 16, 2019 at 5:26

You are getting the full string. The only issue is when you debug it there is a limit on printed characters per debug statement which is likely truncating the output. Hope this helps.

  • Thank you for your time, but I actually inserted that data into the salesforce field and checked, even then I am not able to see the complete String. Also If pass the same value within Apex only from one class to another class and then if I print in System.debug am able to see all 288characters. Only if I am getting it from an external Application using RestAPI then only it is restricting it to 123characters.
    – Jayanth G
    Commented Sep 6, 2019 at 10:59
  • What do you mean by "pass from one class to another class"? Is your rest resource class sending it elsewhere and then is working? Commented Sep 6, 2019 at 15:19
  • Nope what I am trying to tell you is, if I hardcode the string value and print it in system.debug, its printing completely, only when I am receiving it from the above code that is from RestContext.request.params and print it, am getting only 123 characters
    – Jayanth G
    Commented Sep 6, 2019 at 15:51
  • Just out of curiosity, is the field you are saving it to 123 in length? Commented Sep 6, 2019 at 16:18
  • Nope, I am pretty sure the length is more than 300
    – Jayanth G
    Commented Sep 9, 2019 at 8:51

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .