Answer the question
In order to leave comments, you need to log in
How to create a web service in Bitrix that would compare and update the data in the table received from the request?
Hello. Please help in creating a web service in Bitrix.
I can’t find any detailed instructions on creating web services in Bitrix.
It is necessary to write a simple web service that would compare the data and update the table, depending on the data received in the request. The request will be made from the SQL server.
Those. there is a cash desk in a sporting goods store that works with the Navision program, they organize work there in such a way that when you enter, for example, the number of a bonus card, its status, etc. a request was sent directly to the online store, and the service must accept the variable data and update it in the corresponding table.
Answer the question
In order to leave comments, you need to log in
Do I understand correctly that this will be a sql query?
if so, then Bitrix prohibits working directly with sql, everything should work through the Bitrix API.
Accordingly, you either store data in the Bitrix itself, or use hiload,
or deliberately twist the crutch, and Bitrix has nothing to do with this php + sql
Because it is problematic to write web services in Bitrix out of the box, you need / you can use a regular component.
-
1. Create an 'api.php' page with the following content:
<?php
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php");
$APPLICATION->IncludeComponent('site:api', '');
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/epilog_after.php");
?>
<?php
class Api extends CBitrixComponent
{
function executeComponent()
{
// делайте что хотите
}
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question