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
chikkuchikku 

It is possible to insert contact data into external server in Apex API

Have JSON body with the external server I need to map that JSON body into contact fields.it is possible?
 I have shown the below example, like this, it is possible as dynamic, no need to hardcode, it should automatically insert the contact into the external server.

it is possible?
List<Contact> con = [Select Id, Name From Contact]; 

'{'+
 ' "CustomerID": 0,'+
  '"CustomerType": 1,'+
  '"Name":  "con.Name , con.Name",'+ 
 ' "BranchID": 1,'+
 '"CustomerAddress": ['+
   ' {'+ 
     ' "CustomerAddressID": 0,'+
     ' "CustomerID": 0,'+
      '"Address": {'+
       ' "Address1": "con.Name",'+
       ' "TownCityID": con.billinAddress,'+
       ' "CountyID": null,'+
        '"StateID": 41036,'+
        '"CountryID": 4,'+

 
ShivankurShivankur (Salesforce Developers) 
Hi Chikku,

Please check out the implementation done around with similar requirement here in below discussion:
https://developer.salesforce.com/forums/?id=9060G000000Bik0QAC

Hope above information helps. Please mark as Best Answer so that it can help others in future.

Thanks.
 
chikkuchikku
@Shivankur  No this is no solution, I need to map the contact fields into JSON, that was my question