# Kintone Google Docs 連携

**URL:** <https://community.cybozu.dev/t/topic/4832>\
**Category:** kintone 開発相談\
**Created:** [2020 年 1 月 23 日午後 12:06 UTC](https://community.cybozu.dev/t/topic/4832 "2020-01-23T12:06:38Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Legacy\_Account1387](https://avatars.discourse-cdn.com/v4/letter/l/91b2a8/32.png) [@Legacy\_Account1387](https://community.cybozu.dev/u/Legacy_Account1387)\
**Post date:** [2020 年 1 月 23 日午後 12:06 UTC](https://community.cybozu.dev/t/topic/4832/1 "2020-01-23T12:06:38Z")

</div>

お世話になります。

kintoneとgoogle sheetsとの連携はすでに成功しております。

kintoneとgoogle docsとの連携をしようとしております。

GoogleのAPI認証はすでにとれております。

最終的にやりたい事はあるファイルにSearch and Replace

#CompanyName#を会社名でリプレースしたいです。

色々検索したけどサンプルコードが見当たりませんでした。

何かアドバイスございましたら大変たすかります。

よろしくお願いいたします。

---

<div class="post-metadata">

**Author:** ![Legacy\_Account1657](https://avatars.discourse-cdn.com/v4/letter/l/f4b2a3/32.png) [@Legacy\_Account1657](https://community.cybozu.dev/u/Legacy_Account1657)\
**Post date:** [2020 年 2 月 2 日午前 4:28 UTC](https://community.cybozu.dev/t/topic/4832/2 "2020-02-02T04:28:49Z")

</div>

山本さん

こんにちは。

最終的にやりたいことの具体的なイメージができていないのですが、kintoneのレコード情報を取得して、

google docsの情報を書き換えたいとうことでしょうか？

認識があっていれば、google sheetsと連携したときの要領で、google docs側から[レコード取得API](https://community.cybozu.dev/hc/ja/articles/202331474)を実行して、

取得した情報をもとに処理してく感じでうまくいかないでしょうか？

---

<div class="post-metadata">

**Author:** ![Legacy\_Account1387](https://avatars.discourse-cdn.com/v4/letter/l/91b2a8/32.png) [@Legacy\_Account1387](https://community.cybozu.dev/u/Legacy_Account1387)\
**Post date:** [2020 年 2 月 5 日午前 8:11 UTC](https://community.cybozu.dev/t/topic/4832/3 "2020-02-05T08:11:09Z")

</div>

ご回答ありがとうございました。サンプルが見つからなかったので色々と苦労したが、GOOGLEのAPIドキュメントでなんとかわかりました。

大切だったのはSCOPESとDISCOVER\_DOCSでした。

var SCOPES = ‘[https://www.googleapis.com/auth/documents](https://www.googleapis.com/auth/documents) [https://www.googleapis.com/auth/drive.file](https://www.googleapis.com/auth/drive.file) [https://www.googleapis.com/auth/drive](https://www.googleapis.com/auth/drive)’;  
// Discovery Docs  
var DISCOVERY\_DOCS = [‘[https://docs.googleapis.com/$discovery/rest?version=v1’,'https://www.googleapis.com/discovery/v1/apis/drive/v3/rest](https://docs.googleapis.com/%24discovery/rest?version=v1','https://www.googleapis.com/discovery/v1/apis/drive/v3/rest)’];

今後ともよろしくお願いいたします。
