0
vvf
15.01.18
✎
10:39
|
Есть работающий код, с помощью которого я получаю нужные данные из SalesForce.
HTTPЗапрос = Новый HTTPЗапрос("/services/data/v37.0/query?q=SELECT+Id, IsDeleted, MasterRecordId, Name, Type, ParentId, BillingStreet, BillingCity, BillingState, BillingPostalCode, BillingCountry, BillingLatitude, BillingLongitude, BillingGeocodeAccuracy, BillingAddress, ShippingStreet, ShippingCity, ShippingState, ShippingPostalCode, ShippingCountry, ShippingLatitude, ShippingLongitude, ShippingGeocodeAccuracy, ShippingAddress, Phone, Website, PhotoUrl, Industry, NumberOfEmployees, Description, CurrencyIsoCode, OwnerId, CreatedDate, CreatedById, LastModifiedDate, LastModifiedById, SystemModstamp, LastActivityDate, LastViewedDate, LastReferencedDate, Jigsaw, JigsawCompanyId, AccountSource, SicDesc+from+Account", Соответствие1);
HTTPОтвет = HTTPСоединение.ВызватьHTTPМетод("get", HTTPЗапрос);
Token1 = HTTPОтвет.ПолучитьТелоКакСтроку();
Сообщить(Token1);
А как можно решить обратную задачу, добавлять/менять данные в SalesForce из 1С?
Вот примеры, какие описаны у них в инструкциях
Upserting New Records
This example uses the PATCH method to insert a new record. It assumes that an external ID field, “customExtIdField__c,” has been added to Account. It also assumes that an Account record with a customExtIdField value of 11999 does not already exist.
Example for upserting a record that does not yet exist
curl -H "Authorization: Bearer token" -H "Content-Type: application/json" -d @newrecord.json -X PATCH
Example JSON request body newrecord.json file
1
{
2
3
"Name" : "California Wheat Corporation",
4
"Type" : "New Customer"
5
6
}
Response
Successful response:
1
{
2
"id" : "00190000001pPvHAAU",
3
"errors" : [ ],
4
"success" : true
5
}
HTTP status code 201 is returned if a new record is created.
Как эту конструкцию преобразовать в код для 1С или есть способ как то отправить данные из моего примера, когда я получаю данные.
|
|