• Karuna kriti
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies
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);
   
    }
  
 }