2017 © Pedro Peláez
 

craft-plugin rest

REST plugin for Craft CMS

image

dukt/rest

REST plugin for Craft CMS

  • Monday, October 2, 2017
  • by benjamindavid
  • Repository
  • 2 Watchers
  • 0 Stars
  • 6 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

REST for Craft CMS

Perform authenticated REST requests, (*1)


Table of Contents

Installing and updating

Requirements

  • Craft 2.5
  • Craft OAuth 1.0

Installation

  1. Download the latest release of the plugin
  2. Drop the rest plugin folder to craft/plugins
  3. Install REST plugin from the control panel in Settings > Plugins

Updating

  1. Download the latest release of the plugin
  2. Replace the rest plugin folder by the new one under craft/plugins
  3. Access your Craft control panel. You might be prompted to "Finish Up" the update if one or more migrations need to be applied.

Requests

Simple Request

{% set response = craft.rest.request.url('http://api.openweathermap.org/data/2.5/weather?q=London,uk&appid=2de143494c0b295cca9337e1e96b00e0').send() %}

<pre>{{ dump(response) }}</pre>

Query Parameters

{% set response = craft.rest.request
    .url('http://api.openweathermap.org/data/2.5/weather')
    .query({
        q: 'London,uk',
        appid: '2de143494c0b295cca9337e1e96b00e0',
    })
    .send() %}

Authentication

{% set response = craft.rest.request
    .authentication('youtube')
    .url('https://www.googleapis.com/youtube/v3/search')
    .query({
        part: 'snippet',
        q: 'timelapse',
    })
    .send() %}

Token

{% set response = craft.oauth.getTokenById(123) %}

{% set response = craft.rest.request
    .token(token)
    .url('https://www.googleapis.com/youtube/v3/search')
    .query({
        part: 'snippet',
        q: 'timelapse',
    })
    .send() %}

Authentications

Supported Providers

You can set up authentication with any OAuth provider provided by the OAuth plugin:, (*2)

  • Facebook
  • GitHub
  • Google
  • Slack
  • Twitter
  • Vimeo

The plugin also supports any third party OAuth providers supported by the OAuth plugin., (*3)

Dukt.net © 2017 - All rights reserved, (*4)

The Versions

02/10 2017

v1.x-dev

1.9999999.9999999.9999999-dev

REST plugin for Craft CMS

  Sources   Download

02/10 2017

1.1.1

1.1.1.0

REST plugin for Craft CMS

  Sources   Download

30/09 2017

1.1.0

1.1.0.0

REST plugin for Craft CMS

  Sources   Download

18/03 2015

0.9.4

0.9.4.0

  Sources   Download

11/03 2015

0.9.3

0.9.3.0

  Sources   Download

24/11 2014

0.9.2

0.9.2.0

  Sources   Download

24/11 2014

0.9.1

0.9.1.0

  Sources   Download