Sales Layer API allows to update its online database using the POST parameters of the calls.

This method is available from the API version 1.14

From the connector, you can configure the permissions to update some fields and protect the rest (for security reasons).

How to update records

This mode has been designed to update scattered data among different records (categories, products or formats):


	
“input_data” = [

	“{table name}” = [

		[
			”ID”  = “{Unique ID of the record in Sales Layer}” or…
			“REF” = “{Unique reference of the record}”

			“{field name}” = “{new value of the field}”,
			“{field name}” = “{new value of the field}”,
			...
		],
		[ … ]
	],
	“{name of the other table}” = [
		...
	]
]

How to remove records through the API



“delete_data” = [

	“{table name}” = [

		[
			”ID”    = “{Unique ID of the record in Sales Layer}” or…
			“REF” = “{Unique reference of the record}”
		],
		…
	],
	...
]


Response and errors

The response of the updates can be found in the parameter “input_response” (provided in JSON or XML mode). The structure is as follows:



“input_response” = [

	“result”= (0 = no updates, 1 = update successfull, 2 = update denied)
	“errors” = [

      		 0   = “{error description}”,
	   	{n} = …
                ],
	“items_affected” = [

		“{table name}” = {number of fields modified},
	]
]

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>