login
login
Belgeler

API Sürümü 1.1

This documentation explain how to register, configure, and develop your app so you can successfully use our APIs

Uygulama Oluştur

Uygulamanızın API'lerimize erişmesi için, uygulamanızı aşağıdakileri kullanarak kaydetmeniz gerekir: Uygulama Kontrol Paneli. Registration creates an App ID that lets us know who you are, helps us distinguish your app from other apps.

  1. You will need to create a new App Yeni uygulama oluştur
  2. Uygulamanızı oluşturduktan sonra, app_id Ve app_secret
İle giriş

Sistemle Giriş Yap, insanların hesap oluşturması ve uygulamanızda oturum açması için hızlı ve kolay bir yoldur. Şununla Oturum Aç sistemimiz, kimlik doğrulama ve insanların verilerine erişmek için izin isteme olmak üzere iki senaryo sağlar. Login With sistemini yalnızca kimlik doğrulama veya hem kimlik doğrulama hem de veri erişimi için kullanabilirsiniz..

  1. Starting the OAuth login process, You need to use a link for your app like this:
    <a href="https://staging.lifesosyal.com/api/oauth?app_id=YOUR_APP_ID">Log in With otolife</a>

    The user will be redirect to Log in With page like this

  2. Kullanıcı, uygulamanızı kabul ettikten sonra, şu şekilde Uygulama Yönlendirme URL'nize yönlendirilir: auth_key bunun gibi:
    https://mydomain.com/my_redirect_url.php?auth_key=AUTH_KEY
    This auth_key valid only for one time usage, so once you used it you will not be able to use it again and generate new code you will need to redirect the user to the log in with link again.
Erişim Jetonu

Uygulamanızın kullanıcı onayını aldıktan sonra Log in With penceresi ile geri dönün auth_key which means that now you are ready to retrive data from our APIs and to start this process you will need to authorize your app and get the access_token ve nasıl alacağınızı öğrenmek için adımlarımızı takip edebilirsiniz..

  1. To get an access token, make an HTTP GET request to the following endpoint like this:
                <?php
                $app_id = "YOUR_APP_ID"; // your app id
                $app_secret = "YOUR_APP_SECRET"; // your app secret
                $auth_key = $_GET['auth_key']; // the returned auth key from previous step
    
                $get = file_get_contents("https://staging.lifesosyal.com/api/authorize?app_id=$app_id&app_secret=$app_secret&auth_key=$auth_key");
    
                $json = json_decode($get, true);
                if(!empty($json['access_token'])) {
                    $access_token = $json['access_token']; // your access token
                }
                ?>                                                                                                
                                
    This access_token valid only for only one 1 hour, so once it got invalid you will need to genarte new one by redirect the user to the log in with link again.
API'ler

seninkini aldıktan sonra access_token Artık aşağıdaki parametreleri destekleyen HTTP GET istekleri aracılığıyla sistemimizden bilgi alabilirsiniz.

uç nokta Açıklama
api/get_user_info

kullanıcı bilgisi al

You can retrive user info like this

            if(!empty($json['access_token'])) {
                $access_token = $json['access_token']; // your access token
                $get = file_get_contents("https://staging.lifesosyal.com/api/get_user_info?access_token=$access_token");
            }
                        

The result will be:

            {
              "user_info": {
              "user_id": "",
              "user_name": "",
              "user_email": "",
              "user_firstname": "",
              "user_lastname": "",
              "user_gender": "",
              "user_birthdate": "",
              "user_picture": "",
              "user_cover": "",
              "user_registered": "",
              "user_verified": "",
              "user_relationship": "",
              "user_biography": "",
              "user_website": ""
              }
            }
                      
.