Not able to create an API call in php

Pushsafer make it easy and safe to get push-notifications in real time on your Android or Windows mobile device, iPhone, iPad and Desktop!

Mit Pushsafer kann man in Echtzeit, einfach und sicher, Push-Benachrichtigungen auf sein iPhone, iPad, Android oder Windows Gerät sowie auf den Desktop senden lassen!

======================
Google Play
App Store
Windows 10 Store
Homepage
albertlindeboom
Posts: 1
Joined: 22. Mar 2020, 17:18

Not able to create an API call in php

Postby albertlindeboom » 22. Mar 2020, 17:25

Hi,

I haven't managed to create a successfull API call in PHP, i tried a number of variations.
My connection is secure, can anyone point me in the right direction?

Code: Select all

<?php
$message= 'hi'
$ch = curl_init();
$data = array(
	'm' => urldecode($message),
	'k' => xxxxx
);
$postString = http_build_query($data, '', '&');
curl_setopt($ch, CURLOPT_URL, 'https://www.pushsafer.com/api' );
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postString);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false );
$response = curl_exec($ch);
curl_close($ch);
?>

User avatar
admin
Site Admin
Posts: 537
Joined: 1. Dec 2014, 12:41
Location: Germany

Re: Not able to create an API call in php

Postby admin » 22. Mar 2020, 20:19

Hi,

do you get any error from your script or do you get a response from the pushsafer server?

You script have some errors!
Here oyu will find a correct one in sectipn PHP (CURL)

https://www.pushsafer.com/en/pushapi

Kevin
DE: Dir gefällt Service und Support! Dann freuen wir uns auf deine Bewertung!
EN: You like Service and Support! Then we look forward to your review!

Pushsafer.com Website - iOS - Android - Windows 10


Who is online

Users browsing this forum: No registered users and 3 guests