app icon indicating copy to clipboard operation
app copied to clipboard

PHP

Open 100doses opened this issue 3 years ago • 5 comments

Will this support PHP ?

100doses avatar Sep 03 '22 07:09 100doses

What is your question? SimpleLogin is not written in PHP if that is what you're wondering about. You can review the full source code here on GitHub.

salixh5 avatar Sep 03 '22 19:09 salixh5

What is your question? SimpleLogin is not written in PHP if that is what you're wondering about. You can review the full source code here on GitHub.

I would like to implement the API in PHP but i not found any libraries to do it.

ghost avatar Sep 04 '22 21:09 ghost

I think i posted in the wrong repo btw.

ghost avatar Sep 04 '22 21:09 ghost

implement the API

If by "implementing" you mean that you want to send requests to the SimpleLogin API in your PHP app, then the answer would be yes, you can use any programming language.

Simple example:

$api_key = "your_api_key";
$api_root = "https://app.simplelogin.io";
$api_route = "/api/v5/alias/options";
$header = [
  "Content-Type: application/json",
  "Cache-Control: no-cache",
  "User-Agent: Name of your app",
  "Authentication: $api_key",
];

$ch = curl_init();
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_SSLVERSION, CURL_SSLVERSION_TLSv1_2);
curl_setopt($ch, CURLOPT_POST, false);
curl_setopt($ch, CURLOPT_POSTFIELDS, null);
curl_setopt($ch, CURLOPT_HTTPGET, true);
curl_setopt($ch, CURLOPT_URL, $api_root . $api_route);
curl_setopt($ch, CURLOPT_HTTPHEADER, $header);

$result = json_decode(curl_exec($ch), true);
var_dump($result);

salixh5 avatar Sep 07 '22 13:09 salixh5

Sorry for the delay, thanks for your answer, i'll try it and i will comeback to confirm if it's working or not later.

ghost avatar Oct 20 '22 08:10 ghost