LoginSignup
2
2

More than 3 years have passed since last update.

やりたかった事

Firebaseを利用してLINE X WEBアプリのデータを一元管理する仕組みを使ったのですが、データをより扱いやすくする為に、スプレッドシートへ自動書き込みを行うというチャレンジ
iPassを利用して、ノンコードで実装!

Firebaseを利用して、LINEで予約状況を照会で受け取ったデータベースを利用します。

Integromatとは

IFFFやzapiaのようにiPassサービスの一つ
zapiaのwebhookを利用しようと思ったら有料プラン限定のサービスだったので、無料でwebhookが利用できるサービスです。

image.png

環境

・Integromat

下準備

事前にFirebaseを構築

・データベースの構築
・クライアントIDとシークレットを取得

これについては以下の記事で紹介しています。
Firebaseを利用して、LINEで予約状況を照会

Integromatとfirebaseを接続

Google Cloud Platformで認証キーを発行します。

APIとサービス

image.png

image.png

Google Cloud Firestore APIを検索、有効化

image.png

OAuth同意画面

image.png

外部を選択

image.png

アプリ名を入力

任意の名前を付けます。
後は赤い米印のついているメールアドレス入力欄の設定します。
image.png

認証済ドメイン

integromat.comを追加しておきます。
image.png

スコープを追加

https://www.googleapis.com/auth/datastore
https://www.googleapis.com/auth/cloud-platform
上記2つが必要です
image.png

image.png

認証情報

image.png

必要な情報
アプリケーションタイプ Web application
名前 Integromat(任意)
許可されたリダイレクトURI

https://www.integromat.com/oauth/cb/google-custom

クライアントIDとクライアントシークレット発行完了

image.png

アプリを公開

image.png

レシピ

Integromatにログインをして作業を進めます。

Scenariosを選択

image.png

Create a new Scenarios

image.png

Google Cloud Firestoreを選択 【continue】
image.png

List Documentsを選択

image.png

接続するアプリを選択

image.png

addをクリック

image.png

準備で取得したキーを入力

クライアントID
クライアントシークレット
2つを入力してします。そうすると以下の画面になるので、安全ではないページに移動をクリックして認証を進めます。
image.png

接続完了

接続したいprojectを選択
image.png

スプレッドシートを繋ぎます

image.png

行の追加を選択しました。
image.png

あらかじめ作成しておいたスプレッドシートを選択
image.png

列に何の値を入れるか設定します
image.png

run

image.png

まとめ

ドキュメントに入っているフィールド値を取得したかったのに、ドキュメント一覧しか取得できませんでした。
Google Cloud Firesotreではなく、他にパーツがあるのかもしれません。

とはいえ、認証キーの発行が必要である事がわかりFirestoreに繋げる事が出来て良かったです。

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2