• 07-02-2020, 17:42:29
    #1
    selam arkadaşlar,
    Hepsiburada api ile çalışıyorum ve token almam gerekiyor. Bir kaç yol denedim destek tarafı'da çok geç ve olumlu birşeyler yazmayınca danışmak istedim.
    Daha önce api ile çalışan varsa yardımcı olursa memnun olurum.
    Örnek İstek: bu şekilde request yapılması isteniyor.
    POST /api/authenticate
    Host: mpop-sit.hepsiburada.com
    Content-Type: application/json
    
    {
    "username": "xyz_dev",
    "password": "XYZ_dev123!",
    "authenticationType": "INTEGRATOR"
    }
    hazırladığım request
    $url = 'https://mpop-sit.hepsiburada.com/api/authenticate/';
    $ch = curl_init($url);
    $header = array(
        'Content-Type: application/json',
        'Authorization: Bearer '. base64_encode('xyz_dev:XYZ_dev123!:INTEGRATOR'),
    );
    curl_setopt($ch, CURLOPT_HTTPHEADER, $header);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
    $result = curl_exec($ch);
    $return=json_decode($result,true);
    print_r($return);
    Sonuç: JWT strings must contain exactly 2 period characters. Found: 0
    gibi bir hata alıyorum.
  • 07-02-2020, 17:45:52
    #2
    Üyeliği durduruldu
    $data = array("username" => "asdasd", "password" => "asdasd","authenticationType" => "INTEGRATOR" );                                                                    $data_string = json_encode($data);                                                                                                                                                                                                        $ch = curl_init('[URL]https://mpop-sit.hepsiburada.com/api/authenticate/[/URL]');                                                                      curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");                                                                     curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);                                                                  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);                                                                      curl_setopt($ch, CURLOPT_HTTPHEADER, array(                                                                              'Content-Type: application/json',                                                                                    'Content-Length: ' . strlen($data_string))                                                                       );                                                                                                                                                                                                                                        $result = curl_exec($ch);
    şeklinde dener misiniz ? header olarak değil json body olarak istiyor sizden datayı
  • 07-02-2020, 18:07:14
    #3
    Larus adlı üyeden alıntı: mesajı görüntüle
    $data = array("username" => "asdasd", "password" => "asdasd","authenticationType" => "INTEGRATOR" );                                                                    $data_string = json_encode($data);                                                                                                                                                                                                        $ch = curl_init('[URL]https://mpop-sit.hepsiburada.com/api/authenticate/[/URL]');                                                                      curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");                                                                     curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string);                                                                  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);                                                                      curl_setopt($ch, CURLOPT_HTTPHEADER, array(                                                                              'Content-Type: application/json',                                                                                    'Content-Length: ' . strlen($data_string))                                                                       );                                                                                                                                                                                                                                        $result = curl_exec($ch);
    şeklinde dener misiniz ? header olarak değil json body olarak istiyor sizden datayı
    Teşekkür ederim.
    Daha önce de buna benzer bir örnek yaparak denedim, 401-Access Denied hatası aldım. Destek sorun yok dedi ama erişim hatası olduğunu görüyorum. Sorun ne gerçekten anlamadım.
  • 07-07-2020, 13:28:07
    #4
    Hocam bende 2-3 gundur denıyorum sizin mesajınızı gordum token alma işlemı ıcın
    siz yapabıldınız mı acaba .
    Array ( [timestamp] => 2020-07-07T10:24:55.411+0000 [status] => 401 [error] => Unauthorized [message] => Access Denied [path] => /api/authenticate/ )
    Hatasını verıyor sürekli.

    Abm adlı üyeden alıntı: mesajı görüntüle
    Teşekkür ederim.
    Daha önce de buna benzer bir örnek yaparak denedim, 401-Access Denied hatası aldım. Destek sorun yok dedi ama erişim hatası olduğunu görüyorum. Sorun ne gerçekten anlamadım.
  • 08-07-2020, 13:41:16
    #5
    Hocam Sizin Veriğiniz Şekilde Nasıl Kullanmam Gerek Acaba Örnek Verebılır Mısınız Birkaç denem yaptım ama
    Array ( [timestamp] => 2020-07-07T10:24:55.411+0000 [status] => 401 [error] => Unauthorized [message] => Access Denied [path] => /api/authenticate/ )
    Cevap Donuyor. yardımcı Olabılır Mısınız


    Larus adlı üyeden alıntı: mesajı görüntüle
    $data = array("username" => "asdasd", "password" => "asdasd","authenticationType" => "INTEGRATOR" ); $data_string = json_encode($data); $ch = curl_init('[URL]https://mpop-sit.hepsiburada.com/api/authenticate/[/URL]'); curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST"); curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json', 'Content-Length: ' . strlen($data_string)) ); $result = curl_exec($ch);
    şeklinde dener misiniz ? header olarak değil json body olarak istiyor sizden datayı
  • 13-11-2020, 15:52:47
    #6
    Dostum selam baya geç oldu belki halen ihtiyacın vardır yada başka birinin ihtiyacı olabilir ondan dolayı hortlatıyorum konuyu. Ben çözümünü buldum galiba

    1. $url = 'https://mpop-sit.hepsiburada.com/api/authenticate/'; en sondaki / karakterini kaldırman gerekiyor.
    2. Sonuç dönmüyordu hatayı görmek için curl_error($ch) yaptım SSL hatası verdi localhost ta olmuyor zaten, sunucuya SSL yükledim sorunsuz token alıyor artık.