Giter Site home page Giter Site logo

hasan-dot / snapchat-sdk Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 25 KB

⛔️ DEPRECATED: A PHP SDK that can be used to get all marketing spending data and other KPIs using Snapchat API calls.

License: MIT License

PHP 100.00%
archived deprecated incomplete obsolete

snapchat-sdk's Introduction

⛔️ DEPRECATED

Snapchat Marketing SDK

A PHP SDK that can be used to get all marketing spending data and other KPIs using Snapchat API calls.

Don't forget to edit the HttpHandler/SnapHttpConstants.php file.

Example:

$auth = new  AuthBuilder('{{CLIENT_ID}}', '{{CLIENT_SECRET}}', '{{REDIRECT_URI}}');
try{
  $auth->build();
  $accounts = new AdAccountEntityArray($auth, '{{ORGANIZATION_ID}}');
  $accounts->buildCurrentEntities();
  $accounts->getAllSubEntities($accounts);
  $org = [
    'id' => '{{ORGANIZATION_ID}}',
    'children' => []
  ];
  foreach ($accounts->getElements() as $acc){
    array_push($org['children'], $acc->printObject());
  }
  echo json_encode($org);
}catch (Exception $e){
  echo $e->getTraceAsString() . PHP_EOL;
  echo $e->getMessage();
}

Response

{
  "id": "ORGANIZATION_ID",
  "children": [
    {
      "adaccount_id": "AD_ACCOUNT_ID",
      "adaccount_name": "AD_ACCOUNT_NAME",
      "adaccount_children": [
        {
          "campaign_id": "CAMPAIGN_ID",
          "campaign_name": "CAMPAIGN_NAME",
          "campaign_children": [
            {
              "adsquad_id": "AD_SQUAD_ID",
              "adsquad_name": "AD_SQUAD_NAME",
              "adsquad_children": [
                {
                  "ad_id": "AD_ID",
                  "ad_name": "AD_NAME",
                  "ad_children": [],
                  "ad_created_at": "2018-10-18",
                  "ad_updated_at": "2018-10-18"
                },
                {
                ...
                }
              ],
              "adsquad_created_at": "2018-10-18",
              "adsquad_updated_at": "2019-10-02"
            },
            {
            ...
            }
          ],
          "campaign_created_at": "2018-10-18",
          "campaign_updated_at": "2018-10-22"
        },
        {
        ...
        }
      ]
    },
    {
    ...
    }
  ]
}

snapchat-sdk's People

Contributors

hasan-dot avatar

Watchers

 avatar

snapchat-sdk's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.