VANA/VANA-php/app/Srgssr/Api.php

32 lines
636 B
PHP
Raw Permalink Normal View History

2024-10-11 08:02:45 +02:00
<?php
namespace App\Srgssr;
use App\Srgssr\Auth;
class Api
{
public $endpoint;
public $token;
public $headers;
/**
* Initialize Bearer Token for SRGSSR API calls.
* https://developer.srgssr.ch/getting-started/how-update-srg-ssr-oauth-security
*/
public function __construct()
{
$this->token = Auth::token($this->endpoint);
$this->headers = [
'accept' => 'application/json',
'Authorization' => 'Bearer '.$this->token,
'Cache-Control' => 'no-cache',
'Postman-Token' => '561XX353-805e-4974-66XX-5efXX86e2d80'
];
}
}