Finally I found the solution!! , I write myself to help another who is with the same problem:
You only have to add the identifier on the request url, in my case the identifier of the customer table ('/Customer(No='.$identifier.')')
This is a sample code in PHP with guzzle and table customer of Dynamics NAV:
$client = new GuzzleHttpClient();
$uri=env('HTTP_URIBASE', '');
$apiRequest = $client->request('DELETE', $uri.'/Customer(No='.$identifier.')',[
'auth' => [env('HTTP_USERNAME', 'usuari'),env('HTTP_PASSWORD', ''), 'ntlm' ],
'headers' => ['Content-Type' => 'application/json',
'Accept' => 'application/json']
]);
$content = json_decode($apiRequest->getBody()->getContents());
for updates (PATCH) I have to first read the etag of the reccord (@odata.etag), and add on the headers (If-Match value) for update:
$client = new GuzzleHttpClient();
$uri=env('HTTP_URIBASE', '');
// get the recordset of the customer
$apiRequest = $client->request('GET', $uri.'/Customer(No='.$identifier.')',[
'auth' => [env('HTTP_USERNAME', 'usuari'),env('HTTP_PASSWORD', ''), 'ntlm' ]
]);
$content = json_decode($apiRequest->getBody()->getContents());
$etag= $content->{'@odata.etag'};
// update description of the customer
$apiRequest = $client->request('PATCH', $uri.'/Customer(No='.$identifier.')',[
'auth' => [env('HTTP_USERNAME', 'usuari'),env('HTTP_PASSWORD', ''), 'ntlm' ],
'headers' => ['Content-Type' => 'application/json',
'Accept' => 'application/json',
'If-Match' =>$etag ],
'body' => '{"Name":"'.$missatge.'"}'
]);
$content = json_decode($apiRequest->getBody()->getContents());