1. Go to this page and download the library: Download optigov/optigov-api-php library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
optigov / optigov-api-php example snippets
$optiGov = new \OptiGov\Client(API_ENDPUNKT, OAUTH_AUTH_ENDPUNKT, OAUTH_TOKEN_ENDPUNKT);
// get data needed for OAuth2.0 authorization
$oauthInformation = $optiGov->oauthAuthorize(
OPTIGOV_OAUTH_CLIENT_ID,
OPTIGOV_OAUTH_CLIEBNT_REDIRECT_URL,
);
// get state and code verifier and authorization url
$state = $oauthInformation["state"];
$codeVerifier = $oauthInformation["code_verifier"];
$url = $oauthInformation["url"];
// get tokens form oauth token endpoint
$tokens = $optiGov->oauthGetTokens(
$codeVerifier, // code verifier from step one
$_GET["code"], // code from the get parameters
OPTIGOV_OAUTH_CLIENT_ID,
OPTIGOV_OAUTH_CLIEBNT_REDIRECT_URL,
);
const BACKEND_URL = "https://..."; // API-Endpunkt
const REFRESH_TOKEN = "..."; // Refresh-Token eines Bürgers
const TEST_CHAT_ID = -1; // ID eines Chats, welcher dem Bürger gehört
const TEST_ANTRAG_FORMULAR_ID = -1; // ID eines Antrags, welcher im Namen des Bürgers gestellt wird
const TEST_ANTRAG_WEITERLEITUNG_URL = "https://..."; // Ziel-URL für erfolgreiche Weiterleitung nach Antragdurchführung
const TEST_ANTRAG_PARAMETER = []; // Parameter, welche dem Antrag übergeben werden
bash
composer
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.