Perform authentication into flurry website using curl

拟墨画扇 提交于 2019-12-02 04:09:17

问题


I need to perform authentication into flurry website and accordingly get insights from it using curl.Please assist me in its implementation.

Following is implemented code snippet

    $ch=curl_init();
    $url='https://auth.flurry.com/auth/v1/session';
    curl_setopt($ch, CURLOPT_URL, $url);
    $headers=array('Content-Type:application/vnd.api+json');
    curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
    curl_setopt($ch, CURLOPT_POST, true);
    $post='{"data":{"type":"session","id":"bc150468-5bd8-4914-b00a-0ee496a2aa98","attributes":{"scopes":"","email":"email","password":"password","remember":"false"}}}';
    curl_setopt($ch, CURLOPT_POSTFIELDS,$post);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_FOLLOWLOCATION, TRUE);
    $data = curl_exec($ch) or exit(curl_error($ch));
    print_r($data);

    curl_setopt($ch, CURLOPT_URL, 'https://dev.flurry.com/entitiesSummaryJson.do?appSpotOrAppCircleData=0&intervalCut=customInterval2016_07_16-2016_07_16&entityType=adSpace&zoom=d&json=true&metrics=impressions,clicks,ctr,applicationAdConversions,videoCompletions,erpm,revenue,requests,fillrate,ds_fillrate');
    $response=curl_exec($ch) or exit(curl_error($ch));

Upon execution of above code snippet it fails to get insights inspite of successful authentication

来源:https://stackoverflow.com/questions/39159305/perform-authentication-into-flurry-website-using-curl

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!