_RJ 技術メモ

人生を豊かにする技術を提供する、筋肉

Google Slides APIを試す

googleapi googleSlidesAPI

1. アクセストークンの取得

↓以下の記事を参照 http://qiita.com/_RJ/items/186f5e9c6d7610a39d01 認証コードの取得のscopeには、

https://www.googleapis.com/auth/drive%20https://www.googleapis.com/auth/drive.readonly%20https://www.googleapis.com/auth/presentations%20https://www.googleapis.com/auth/presentations.readonly

を使用する。

2. スライドの取得

  1. アクセストークンの入力
  2. presentationIdの入力
    (https://s.google.com/presentation/d/{presentationId}/edit#slide=id.p)
  3. 以下のコマンドを打つ
curl \ 
-i -H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Content-Length: 0" \
-H "Authorization: Bearer {アクセストークン}" \
-X GET "https://slides.googleapis.com/v1/presentations/{presentationId}"

3. ページの取得

  1. アクセストークンの入力
  2. presentationIdの入力
    (https://s.google.com/presentation/d/{presentationId}/edit#slide=id.p)
  3. presentationIdの入力
    (https://docs.google.com/presentation/d/{presentationId}/edit#slide=id.{pageId})
  4. 以下のコマンドを打つ
curl \
-i -H "Accept: application/json" \
-H "Content-Type: application/json" \
-H "Content-Length: 0" \
-H "Authorization: Bearer {アクセストークン}" \
-X GET "https://slides.googleapis.com/v1/presentations/{presentationId}/pages/{pageObjectId}"