Zugang zum REST des CRM 2015 vor-Ort in PHP API

Aus De Ikoula wiki
Jump to navigation Jump to search

fr:Accéder à l'API REST de CRM 2015 On-Premise en PHP en:Access to the API REST of CRM 2015 On-Premise in PHP es:Con el resto de la API de CRM 2015 On-Premise en PHP pt:Acesso para o resto da API de CRM 2015 no local em PHP it:Accesso al resto di API di CRM 2015 On-Premise in PHP nl:Toegang tot de API REST van CRM 2015 On-Premise in PHP de:Zugang zum REST des CRM 2015 vor-Ort in PHP API zh:访问 API 其余的 CRM 2015 上-前提在 PHP 中 ar:الوصول إلى بقية API لإدارة علاقات العملاء عام 2015 في الموقع في بي إتش بي ja:API の残りの CRM 2015 オンプレミス php へのアクセス pl:Dostęp do API REST z CRM 2015 wdrożonej w PHP ru:Доступ к API REST из CRM к 2015 году на предприятии в PHP ro:Acces la restul API de CRM 2015 On-Premise în PHP he:גישה לשאר API של CRM 2015 מקומית ב- PHP de:Zugang zum REST des CRM 2015 vor-Ort in PHP API he:גישה לשאר API של CRM 2015 מקומית ב- PHP ro:Acces la restul API de CRM 2015 On-Premise în PHP ru:Доступ к API REST из CRM к 2015 году на предприятии в PHP pl:Dostęp do API REST z CRM 2015 wdrożonej w PHP ja:API の残りの CRM 2015 オンプレミス php へのアクセス ar:الوصول إلى بقية API لإدارة علاقات العملاء عام 2015 في الموقع في بي إتش بي zh:访问 API 其余的 CRM 2015 上-前提在 PHP 中 nl:Toegang tot de API REST van CRM 2015 On-Premise in PHP it:Accesso al resto di API di CRM 2015 On-Premise in PHP pt:Acesso para o resto da API de CRM 2015 no local em PHP es:Con el resto de la API de CRM 2015 On-Premise en PHP en:Access to the API REST of CRM 2015 On-Premise in PHP fr:Accéder à l'API REST de CRM 2015 On-Premise en PHP

Dieser Artikel wurde maschinell übersetzt. Sie können den Artikel Quelle hier ansehen.






Einführung

Dieser Artikel wird Ihnen Zugang zu der API REST de CRM 2015 Vor-Ort mit Sprache PHP. Es ist notwendig, dass Ihre CRM werden im Zusammenhang mit Active DIrectory und im Besitz von den Namen Ihrer Organisation auf CRM.

Setzen Sie ihre Variablen von der Arbeit

// CRM Server
define('CRM_SERVER', 'NOM_DU_SERVEUR_CRM');

// CRM Organization
define('CRM_ORG_NAME', 'NOM_DE_LORGANISATION');

// CRM WSDL
define('CRM_WSDL', 'http://'.CRM_SERVER.'/'.CRM_ORG_NAME.'/XRMServices/2011/OrganizationData.svc');

// Active Directory
define('AD_DOMAIN_CONTROLER', "NOM_DU_SERVEUR_AD");
define("NTLM_LOGIN", "User");
define("NTLM_PASSWORD", "password");

Abrufen von Informationen

In diesem Beispiel werden wir Informationen über ein Konto abrufen.

// On crée l'URL de l'API REST
$url = CRM_WSDL."/AccountSet(guid'GUID_DU_COMPTE')";

// On initialise notre connexion à l'API
$ch = curl_init();
curl_setopt($ch, CURLOPT_USERPWD, NTLM_LOGIN. ':' . NTLM_PASSWORD);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_NTLM);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLINFO_HEADER_OUT, true);
curl_setopt($ch, CURLOPT_FAILONERROR, 0);
curl_setopt($ch, CURLOPT_MAXREDIRS, 100);
				
// On crée nos headers
$headers = array("Content-Type:application/json; charset=utf-8", "Accept:application/json");
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
								
// On récupère le contenu
$account = curl_exec($ch);

Dank dessen Sie Ihr Daten-Konto abrufen JSON.

Informationen aktualisieren

In diesem Beispiel werden wir e-Mails auf einem Konto aktualisieren.

// On crée notre objet à mettre à  jour
$account = array();
$account['EMailAddress1']  = "adresse@domain.tld";

// On encode en JSON
$account = json_encode($account);

// On crée l'URL de l'API REST
$url = CRM_WSDL."/AccountSet(guid'GUID_DU_COMPTE')";

// On initialise notre connexion à l'API
$ch = curl_init();
curl_setopt($ch, CURLOPT_USERPWD, NTLM_LOGIN. ':' . NTLM_PASSWORD);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_NTLM);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLINFO_HEADER_OUT, true);
curl_setopt($ch, CURLOPT_FAILONERROR, 0);
curl_setopt($ch, CURLOPT_MAXREDIRS, 100);
curl_setopt($ch, CURLOPT_POST, 1);

// On crée nos headers
$headers = array("X-HTTP-Method: MERGE", "Content-Type:application/json; charset=utf-8", "Accept:application/json");
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
		
// On l'envoi via CURL
curl_setopt($ch, CURLOPT_POSTFIELDS, $account);

// On récupère le contenu
$response = curl_exec($ch);

Return-Code aus der API

Wenn ein Fehler auftritt der API Gibt ein Array in JSON mit dem Fehlercode und Fehler zu helfen, wenn das Debug. Während ein Update oder Delete, wenn alles richtig, ging der API Gibt eine Variable gleich NULL.

Fazit

Durch diesen Artikel können Sie jetzt mit verbinden der API de CRM 2015 zum Anzeigen oder bearbeiten.



Dieser Artikel erschien Sie nützlich ?

0



Du bist nicht berechtigt Kommentare hinzuzufügen.