Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

citygrid_api

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

citygrid_api

  • 0.0.28
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

= citygrid

Not stable yet. Use at your own risk!

== Getting Started

=== Installation

This gem is still under very active development. As such, you can obtain the latest by directly installing from github:

gem "citygrid_api", :git => "git://github.com/CityGrid/citygrid_api.git"

You can get a relatively stable build from rubygems.org. Specifying a version number is highly recommended as there will be breaking changes until we stabilize.

gem "citygrid_api", "0.0.6"

=== Configuration

Add a file called citygrid_api.rb under config/initializers.

Configure the gem to use your publisher code with:

CityGrid.publisher = 'your_publisher_code'

Additional options are available such as:

CityGrid.print_curls = true/false CityGrid.custom_timeout = 20 #time in seconds CityGrid.raise_errors = true/false

If you don't have a publisher code, you can obtain one at http://developer.citygridmedia.com

Move citygrid_api.yml.sample into your project. This file configures the API endpoints. Load the configuration with:

CityGrid.load_config 'path/to/config/yml'

== Sessions

Most methods require an AuthToken. This is obtained by either using the CityGrid::Session class (preferred) or CityGrid::API::Accounts::Account.login, which would require managing your own AuthToken.

An authenticated session can be obtained with

session = CityGrid.session 'username', 'password'

Once authenticated, the session will automatically pass along the AuthToken to API methods that require it when you use the call_api method

session.call_api CityGrid::API::Advertising::Category, :search, :keywords => "pizza"

This corresponds to

auth_token = 'my_auth_token' # obtained by calling CityGrid::API::Accounts::Account.login CityGrid::API::Advertising::Category.search :token => auth_token, :keywords => "pizza"

In the future, AuthTokens may be invalidated and there may be other methods to log in. Session and call_api will handle that for you.

FAQs

Package last updated on 19 Jul 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc