Dokumentation för API-funktioner
PUT CRM/Contact/{customerId}/{contactId}/Searching Ska kontaktens sökprofiler matchas Request Information URI Parameters
NamnBeskrivningTypInformation
customerId kund-id string Krävs
contactId Kontaktid. string Krävs
Body Parameters Data CrmContactSearching
NamnBeskrivningTypInformation
ShouldBeMatched ShouldbeMatched

Request Formats

{
  "shouldBeMatched": "Yes"
}
<CrmContactSearching xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Express.Connect.Api.Models.Contact.Crm">
  <ShouldBeMatched>Yes</ShouldBeMatched>
</CrmContactSearching>
Response Information Resource Description Ska kontaktens sökprofiler matchas

Kodexempel

curl "https://connect.maklare.vitec.net/CRM/Contact/StringValue/StringValue/Searching" -X PUT -H "Content-Type: application/json" -H "Authorization: basic {Base64 kodad användarnamn och lösenord}" -d {\"shouldBeMatched\":0}
            

$URL = "https://connect.maklare.vitec.net/CRM/Contact/StringValue/StringValue/Searching"
$data = "{`"shouldBeMatched`":0}"
Invoke-WebRequest -Uri $URL -Method PUT -Headers @{"Content-Type" = "application/json"; "authorization" = "basic {Base64 kodad användarnamn och lösenord}"} -Body $data
                

// HttpClientInstance ska deklareras som en singleton
// public static readonly HttpClient HttpClientInstance = new HttpClient {
//     BaseAddress = new Uri("https://connect.maklare.vitec.net"),
//     DefaultRequestHeaders = {
//         Authorization = new AuthenticationHeaderValue("Basic", "{Base64 kodad användarnamn och lösenord}")
//     }
// }
var json = "{\"shouldBeMatched\":0}";
using (var response = await HttpClientInstance.PutAsync("CRM/Contact/StringValue/StringValue/Searching", new StringContent(json, Encoding.UTF8, "application/json"))) {
    if (response.StatusCode == HttpStatusCode.Unauthorized) {
        // Authorization headern är inte korrekt
    }
    if (response.StatusCode == HttpStatusCode.Forbidden) {
        // Begärt data som det saknas åtkomst till
    }
    if (response.StatusCode == HttpStatusCode.InternalServerError) {
        // Oväntat fel, kontakta Vitec
    }
    if (response.StatusCode == HttpStatusCode.BadRequest) {
        var json = await response.Content.ReadAsStringAsync();
        var result = JsonConvert.DeserializeObject<dynamic>(json);
        // Hantera valideringsfel, presenteras i resultatet
    }
}

$URL = "https://connect.maklare.vitec.net/CRM/Contact/StringValue/StringValue/Searching";

$ch = curl_init();

curl_setopt($ch, CURLOPT_USERNAME, "{Användarnamn}");
curl_setopt($ch, CURLOPT_PASSWORD, "{Lösenord}");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_URL, $URL);
$data = "{\"shouldBeMatched\":0}";
$headers = array( "Content-Type: application/json", "Content-Length: " . strlen($data) );
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT');

curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
curl_setopt($ch, CURLOPT_HTTPHEADER, array(
    'Content-Type: application/json',
    'Content-Length: ' . strlen($data)
));

$result = curl_exec($ch);

if (curl_errno($ch)) {
    die(curl_getinfo($ch));
}

$info = curl_getinfo($ch);
curl_close($ch);

$http_code = $info["http_code"];
if ($http_code == 401) {
    // Användarnamnet eller lösenordet är felaktigt
}
if ($http_code == 403) {
    // Begärt data som det saknas åtkomst till
}
if ($http_code == 500) {
    // Oväntat fel, kontakta Vitec
}
if ($http_code == 400) {
    $json = json_decode($result, true);
    // Hantera valideringsfel, presenteras i $json
}

Testformulär Text input