function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Karuna kritiKaruna kriti 

in the future call out class method i got the String json of Standard Event,now i want to insert it into another server which has different fields.so how can i change json fields before inserting

public with sharing class HighSpeed{
//public String thePosting {get;set;}
//public String postingbody{get;set;}
 
    @future(callout=true)
   
public static void thePosting(String MyEvents){  //Set<Id> eventIds
    
    //List<Event> events = [SELECT Id, Subject, StartDateTime, EndDateTime FROM Event WHERE Id IN :eventIds];
    
    String endpoint = 'http://k1irvine.HighSpeedToming.com/api/index.php/events?key=CL3EuX4ttPHpXMB9xuZwHT';
    
    //Map<Id,Event> eventMap=new Map<ID,Event>([select Id, Subject, isAllDayEvent, StartDateTime, EndDateTime from Event]);
    //String EventJson=JSON.serialize(eventMap.values());
   
    String body ='{"memberOnly":"false","eventTheme":-6697728,"totalRacers":200,"eventDesc":"test","EventTypeName":"A&D","eventDuration":200,"eventScheduledTime":"2006-05-26T16:10:00.00"}';
    HttpRequest reqst = new HttpRequest();
    reqst.setEndpoint(endpoint);
    reqst.setHeader('Content-Type','application/json');
    reqst.setbody(MyEvents);
    reqst.setMethod('POST');
    Http h = new Http();
    reqst.setTimeout(100000);
    HTTPResponse response = h.send(reqst);
    List<Event> eventreturn = (List<Event>)Json.deserialize(MyEvents,List<Event>.class);
    //return (HighSpeed) System.JSON.deserialize(MyEvents, HighSpeed.class);
     
    //postingbody = response.getBody();
    //System.debug('*****'+response);
   
    }
  
 }