There are two types of party that need to be created : the party applicant whose partyType is Party1 and the party respondent whose partyType is Party2.

Create the respondent party first

Use the FileId returned previously in order to add the respondent party to the newly created judicial file

var client = new RestClient(" https://api.medicys-conventionnel.fr/api/judicialFile/AddRespondentParty");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\"FileId\" : \"27FF7826-0DED-4101-9FB4-81991117B656\",\"PartyId\" : \"\",\"Contact\": {\"IsCompany\": \"false\",\"Email\": \"[email protected]\",\"CompanyName\": \"\",\"FirstName\": \"John\",\"LastName\" : \"Willians\",\"Address\": \"123 rue Bidon\",\"City\": \"Paris\",\"State\" : \"Ile de France\",\"Country\":\"France\",\"ZipCode\": \"75001\",\"PhoneNumbers\": [{\"PhoneNumber\" : \"8888\",\"PhoneType\": \"MainPhone\"}]}}",  ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
var client = new RestClient(" https://staging-api.medicys-conventionnel.fr/api/judicialFile/AddRespondentParty");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\"FileId\" : \"27FF7826-0DED-4101-9FB4-81991117B656\",\"PartyId\" : \"\",\"Contact\": {\"IsCompany\": \"false\",\"Email\": \"[email protected]\",\"CompanyName\": \"\",\"FirstName\": \"John\",\"LastName\" : \"Willians\",\"Address\": \"123 rue Bidon\",\"City\": \"Paris\",\"State\" : \"Ile de France\",\"Country\":\"France\",\"ZipCode\": \"75001\",\"PhoneNumbers\": [{\"PhoneNumber\" : \"8888\",\"PhoneType\": \"MainPhone\"}]}}",  ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);

Create the applicant party second

Use the same FileId in order to add the applicant party to the same judicial file

var client = new RestClient(" https://api.medicys-conventionnel.fr/api/judicialFile/AddApplicantParty");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddParameter("text/plain", "{\"FileId\" : \"27FF7826-0DED-4101-9FB4-81991117B656\",\"Contact\": {\"IsCompany\": \"true\",\"PublicId\" : \"420495178\",\"Email\": \"[email protected]\",\"CompanyLegalName\": \"Compagnie Bidon\",\"CompanyName\": \"Bindon\",\"Address\": \"123 rue Bidon\",\"City\": \"Paris\",\"State\" : \"Ile de France\",\"Country\":\"France\",\"ZipCode\": \"75003\",\"PhoneNumbers\": [{\"PhoneNumber\": \"5145145114\",\"PhoneType\":\"MainPhone\"}]}}",  ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);
var client = new RestClient(" https://staging-api.medicys-conventionnel.fr/api/judicialFile/AddApplicantParty");
client.Timeout = -1;
var request = new RestRequest(Method.POST);
request.AddParameter("text/plain", "{\"FileId\" : \"27FF7826-0DED-4101-9FB4-81991117B656\",\"Contact\": {\"IsCompany\": \"true\",\"PublicId\" : \"420495178\",\"Email\": \"[email protected]\",\"CompanyLegalName\": \"Compagnie Bidon\",\"CompanyName\": \"Bindon\",\"Address\": \"123 rue Bidon\",\"City\": \"Paris\",\"State\" : \"Ile de France\",\"Country\":\"France\",\"ZipCode\": \"75003\",\"PhoneNumbers\": [{\"PhoneNumber\": \"5145145114\",\"PhoneType\":\"MainPhone\"}]}}",  ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
Console.WriteLine(response.Content);