Пример #1
0
        static ResponseJob SendCSV(RequestJob requestJob, string csv)
        {
            ResponseJob responseJob = CreateJob(requestJob);

            PutFile(responseJob, csv);
            CloseJob(responseJob.ID);
            return(responseJob);
        }
Пример #2
0
 static ResponseJob CreateJob(RequestJob requestJob)
 {
     return(Url.Combine(instanceURL, $"/services/data/{versionAPI}/jobs/ingest")
            .WithHeader("Content-Type", "application/json; charset=UTF-8")
            .WithHeader("Accept", "application/json")
            .WithOAuthBearerToken(access.AccessToken)
            .WithTimeout(200)
            .PostJsonAsync(requestJob).ReceiveJson <ResponseJob>().Result);
 }
Пример #3
0
        static void Bulk()
        {
            RequestJob requestJob = new RequestJob("Carro__c", OperationEnum.upsert, "Name");

            SendCSV(requestJob, File.ReadAllText(@"D:\temp\carros.csv"));
        }