• vinayak b 21
  • NEWBIE
  • 0 Points
  • Member since 2022

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 0
    Replies
In the Lightning Experience for Enterprise Edition the quota column is not visible but in classic i was able to see the quota column. Can you please help
In the Lightning Experience for Enterprise Edition the quota column is not visible but in class i was able to see the quota column. Can you please help
Getting the above error while running the apex class with wrapper class


public class getComments {
    public static void getTickets(){
        HTTP h = new HTTP();
        HTTPRequest r = new HTTPRequest();
        //setHeader('Content-Type', 'application/json');
        r.setHeader('Accept','application/json');
        
        r.setEndpoint('https://criticalriver3509.zendesk.com/api/v2/tickets/2/comments');
        string userName='yatendra.kumar@criticalriver.com';
        string password='yuvi@2552';
        Blob headerValue = Blob.valueOf(username + ':' + password);
        String authorizationHeader = 'BASIC ' + EncodingUtil.base64Encode(headerValue);
        r.setHeader('Authorization', authorizationHeader);
        r.setMethod('GET');
        HTTPResponse resp = h.send(r);
        system.debug(resp.getBody());
       parseZenJSON allTickets = (parseZenJSON)JSON.deserialize(resp.getBody(), parseZenJSON.class);
        system.debug('allTickets---->>'+allTickets);
        //list<case> allCase = new list<case>();
      // for(fromJson.comments t:allTickets.comments)
       // {
       //    
   //    }
    
    
    }  
 
public class parseZenJSON{
    public List<comments> comments;
     public String next_page{get;set;}
    public String previous_page{get;set;}
    public Integer count{get;set;}
 
    class comments {
        public Integer id;    //6370508189725
        public String type;    //Comment
        public Integer author_id;    //6370047624093
        public String body;    //Hi,
          public String html_body;    //<div class="zd-comment" dir="auto">Hi,&nbsp;<br>This is just for the testing.<br><a rel="noopener noreferrer" href="https://criticalriver-vlocity-22-dev-ed.lightning.force.com/lightning/setup/SetupOneHome/home">https://criticalriver-vlocity-22-dev-ed.lightning.force.com/lightning/setup/SetupOneHome/home</a><br></div>
        public String plain_body;    //Hi,&nbsp;
          //    public boolean public;
        public cls_attachments[] attachments;
        public Integer audit_id;    //6370508189597
        public cls_via via;
        public String created_at;    //2022-08-18T09:56:39Z
        public cls_metadata metadata;
    }
 
    class cls_attachments {
        public String url;    //https://criticalriver3509.zendesk.com/api/v2/attachments/6370527990429.json
        public Integer id;    //6370527990429
        public String file_name;    //Sriharsha _Salesforce Developer.docx
        public String content_url;    //https://criticalriver3509.zendesk.com/attachments/token/UBDxRv1ppA1gD50n7B7zbH6Jl/?name=Sriharsha+_Salesforce+Developer.docx
        public String mapped_content_url;    //https://criticalriver3509.zendesk.com/attachments/token/UBDxRv1ppA1gD50n7B7zbH6Jl/?name=Sriharsha+_Salesforce+Developer.docx
        public String content_type;    //application/vnd.openxmlformats-officedocument.wordprocessingml.document
        public Integer size;    //39184
        public cls_width width;
        public cls_height height;
        public boolean inline;
        public boolean deleted;
        public boolean malware_access_override;
        public String malware_scan_result;    //malware_not_found
        public cls_thumbnails[] thumbnails;
    }
 
    class cls_width {
    }
    class cls_height {
    }
    class cls_thumbnails {
    }
    class cls_via {
        public String channel;    //web
        public cls_source source;
    }
    class cls_source {
    //    public cls_from from;
        public cls_to to;
        public cls_rel rel;
    }
    class cls_from {
    }
    class cls_to {
        public String name;    //Yatendra Kumar
        public String address;    //test.kumar@criticalriver.com
    }
    class cls_rel {
    }
    class cls_metadata {
    //    public cls_system system;
        public cls_custom custom;
    }
    class cls_system {
        public String client;    //Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36
        public String ip_address;    //122.161.49.158
        public String location;    //Delhi, DL, India
        public Double latitude;    //28.6542
        public Double longitude;    //77.2373
    }
    class cls_custom {
    }
    class cls_next_page {
    }
    class cls_previous_page {
    }
    public static fromJSON parse(String json){
        return (fromJSON) System.JSON.deserialize(json, fromJSON.class);
    }

     
}

while running the class in apex integraion getting error "
Line: 15, Column: 1
System.JSONException: For input string: "6370508189725" at [line:1, column:15]
OK"