API Dokumentation

Beispiele

OAuth-Flow Beispiel

1. Authorization

                            curl -X POST https://example.com/authorize \
                                -H "Content-Type: application/x-www-form-urlencoded" \
                                        -d "username=testkid123&password=secret&redirect_uri=https://example_callback.com/callback&state=xyz123"
                            

Redirect: https://example_callback.com/callback?code=abc123&state=xyz123

2. Token Abruf

                            curl -X POST https://example.com/token \
                                -H "Content-Type: application/x-www-form-urlencoded" \
                                        -d "grant_type=authorization_code&code=abc123&redirect_uri=https://example_callback.com/callback&client_id=safekidsid-client&client_secret=dein-geheimnis"
                            

Antwort

                            {
                                "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
                                "token_type": "Bearer",
                                "expires_in": 3600,
                                "scope": "kid_verification"
                            }
                            

3. API-Aufruf

                            curl -X GET https://example.com/api/kidverif \
                                -H "Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
                            

Antwort

                            {
                                "username": "testkid123",
                                "kid_id": "SKID-12343-345HG",
                                "age_group": "10 - 14",
                                "verified": true,
                                "platform": "GamingGo"
                            }
                            

Nutze die Daten, um Inhalte anzupassen!