Brandwatch Masterclass: Doing things bigger with the API
 

Like this? Share it with your network

Share

Brandwatch Masterclass: Doing things bigger with the API

on

  • 203 views

NY Masterclass Session, May 8

NY Masterclass Session, May 8

Statistics

Views

Total Views
203
Views on SlideShare
203
Embed Views
0

Actions

Likes
0
Downloads
6
Comments
0

0 Embeds 0

No embeds

Accessibility

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • The Brandwatch API is incredibly powerful and has many uses. <br /> Just some potential use cases here: <br /> Say you want to pull specific metrics into some report you’re doing. You could write a script and pull data directly from Brandwatch through the API and generate your report <br /> Say you have 500 queries to write. You could have some “analyst” write your queries. Compile everything and with one click of a button you could upload those 500 queries all at once! <br />
  • Using the Brandwatch API <br /> Pretty simple, uses 5 basic commands, <br /> GET pulls/request data <br /> POST adds data <br /> PUT edits existing data <br /> PATCH edits parts of data, use it when PUT is too much <br /> DELETE remove data <br />
  • Using the Brandwatch API <br /> OAuth2 is used by FB, TWTR, Google <br /> Grants access to an application <br /> Provides “access tokens” that can be shared between users <br /> Data types <br /> Brandwatch recommends JSON, because this is the native format for most browsers internal scripting engines <br /> XML is a legacy format which most web applicaitons don’t use was the original format of the API1 <br />
  • Cue Nate to write login access <br /> -if user successfully accesses app, will receive: <br /> - access_token: aa000000-0aaa-0000-0a00-aa00a000a00a <br /> - token_type: bearer <br /> - expires_in: 31535999 <br /> - scope: “read trust write” <br /> Access token values can be submitted with any other request to the Brandwatch API <br /> “Expires in” lets you know how long (in seconds) the access token is valid for, default for an API user is one year <br /> So basically when you make a request to the API (put, post, get, etc), you must provide the API with access tokens/must have the above information in the header <br /> Today we’re going to write the login/authorization to Brandwatch API with python class objects to give an idea of structure (which uses params, login, url <br /> So the parameters are as follows: username/pw, grant_type, client_id <br /> Login stores access token when you get it <br /> getUrl generates the URL request (formatting) for the brandwatch API <br /> After the you make this request, the API spits out an access token, you pass the access token back into the URL when you make a request <br /> Once we have this, we can write what the script actually does (here we’re retrieving project ids to use later) <br />
  • Topics extraction by Nate <br /> Querybackfiller/Query Uploader by Tian <br />

Brandwatch Masterclass: Doing things bigger with the API Presentation Transcript

  • 1. Brandwatch API / Doing things bigger with the API Tian Yang US Analytics, tian@brandwatch.com | Tel: +44 (0)1273 234 290 May 2014
  • 2. Contents © 2013 Brandwatch | www.brandwatch.com 2 • About the Brandwatch API • Getting Started • API in Action
  • 3. 3 Brandwatch API © 2013 Brandwatch | www.brandwatch.com
  • 4. Brandwatch API / Brandwatch on the Go 4 The power of Brandwatch API • Automate & iterate tasks! • Generate reports © 2013 Brandwatch | www.brandwatch.com
  • 5. Brandwatch API / Brandwatch on the Go 5 API Request Types • GET • POST • PUT • PATCH • DELETE © 2013 Brandwatch | www.brandwatch.com
  • 6. Brandwatch API / Brandwatch on the Go 6 OAuth2 • Grants access to Brandwatch Formats/Data Types • API2 supports 4 data types • JSON (recommended) • XML • CSV • XLSX © 2013 Brandwatch | www.brandwatch.com
  • 7. 7 Getting Started © 2013 Brandwatch | www.brandwatch.com
  • 8. Getting Started / Logging In 8 OAuth/Tokens • To login, get tokens Getting Information • In request headers in the format: Authorization: bearer [your token] • In the URL as a parameter: &access_token=[your token] • Basic requests are • /projects/summary • /project/{projectid}/queries • /project/{projectid}/queries/{queryid} © 2013 Brandwatch | www.brandwatch.com
  • 9. 9 Action © 2013 Brandwatch | www.brandwatch.com
  • 10. 9 Action © 2013 Brandwatch | www.brandwatch.com