Documentation

crm.item.import

Scope: catalog Permissions to execute: for all

crm.item.import({entityTypeId: number, fields: ?{})

Single entry import.

Parameters

Parameter Description
entityTypeIdelement type identifier (What entities are supported?)
fieldselement field values. You can find out about the set of fields by using REST crm.item.fields, or by using methods for individual types: crm.lead.fields, crm.deal.fields, crm.contact.fields, crm.company.fields, crm.quote.fields.

Method returns array itemwith identifier of created element in case of success, or an error message otherwise.


To load the file, you need to pass as the user field the array with file name as the first element, and the file content, encoded in base64 - as the second element.


You can find additional details about differences of import logic from the logic of standard element adding here.


Example

Deal import:


{
	"entityTypeId": 2,
	"fields": {
		"title": "My deal",
		"categoryId": 0
	}
}

Successful result:
{
"result": {
	"item": {
		"id": 15
	}
}


© «Bitrix24», 2001-2024
Up