Mailee Client v2

БЕЗКОШТОВНО
(Ким) mailee | Оновлено לפני חודשיים | Data
Популярність

2.3 / 10

Затримки

549ms

Рівень обслуговування

100%

Health Check

N/A

Повернутися до всіх обговорень

Erro 500 na API

Rapid account: Lucascolette
lucascolette
לפני 6 שנים

Há algum tempo a API do Mailee só retorna erro 500, sendo que as credenciais e api keys estão todas corretas.

Rapid account: Hericson Ramos
HericsonRamos Commented לפני 6 שנים

Tenta assim!

		// Request Type: GET | POST | PUT | PATCH | DELETE
		// URL
		$url = "https://mailee.p.mashape.com/contacts?api_key=*********&subdomain=*********";
		// request timeout in seconds
		$timeout = 10;
		// Custom headers. X-Mashape-Key is mandatory, you can add more if you want
		$headers = array(
			"X-Mashape-Key: F*************************************7Y",
			"Content-Type: application/x-www-form-urlencoded",
			"Accept : application/json"
		);
		$fields = array(
			'name' => urlencode( $customer_info['firstname']),
			'email' => urlencode($customer_info['email']),
		);
		//url-ify the data for the POST
		foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; }
		rtrim($fields_string, '&');
		
		// Request Type: GET | POST | PUT | PATCH | DELETE
		$method = 'POST';
		$ch = curl_init();
		curl_setopt($ch, CURLOPT_URL, $url);
		curl_setopt($ch,CURLOPT_POST, count($fields));
		curl_setopt($ch,CURLOPT_POSTFIELDS, $fields_string);
		curl_setopt($ch, CURLOPT_HTTPHEADER, $headers );
		curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method);
		curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
		curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, $timeout);
		$data = curl_exec($ch);
		curl_close($ch);
		
		$newUser = json_decode($data);

Приєднуйтесь до обговорення — додайте повідомлення нижче:

Вхід / Реєстрація, щоб публікувати нові повідомлення