Google Apps Script에서 ChatWork API를 사용하여 게시
3310 단어 ChatworkGoogleAppsScript
채팅 워크 API를 Google Apps Script에서 사용해 보았습니다 | 채팅 워크 크리에이터 블로그
절차
1. Google Apps Script 프로젝트 만들기
GoogleDrive의 새로 만들기에서 Google Apps 스크립트를 선택합니다. 존재하지 않는 경우 앱을 추가하고 Google Apps 스크립트를 검색하여 추가합니다.

그러면 프로젝트 유형을 묻는 대화 상자가 열리므로 여기에서는 "빈 프로젝트"로 둡니다.

2. ChatWorkClient 라이브러리 추가
리소스 -> 스크립트...에서 스크립트 추가 대화 상자가 열립니다. 이제 ChatWorkClient의 프로젝트 키를 검색하고 추가합니다. 그런 다음 저장에 OK입니다.
cw-shibuya/chatwork-client-gas

3. 코드 작성
샘플 메소드로서 다음의 메소드를 추가합니다. 게시할 사용자의 API 토큰과 게시할 룸 ID가 필요하므로 미리 준비해 둡시다.
제목 없음.gsfunction sendMessageTest() {
var client = ChatWorkClient.factory({token: 'your_api_token'});
client.sendMessage({room_id: your_room_id, body: 'This message is sent from Google Apps Script by ChatWorkClient.'});
}
4. 실행
실행 -> 만든 메소드에서 스크립트를 실행합니다.

잘하면 ChatWork에 게시됩니다.

[리소스]에서 트리거를 설정할 수 있으므로 정기적인 스크립트 실행도 가능합니다.
이를 기반으로 하면, 각종 Google API와 제휴해, 예를 들면, Analytics의 액세스 정보나 캘린더의 이벤트 정보를 통지하는 등, 여러가지 응용할 수 있을 것 같습니다.
기타 참고 URL
function sendMessageTest() {
var client = ChatWorkClient.factory({token: 'your_api_token'});
client.sendMessage({room_id: your_room_id, body: 'This message is sent from Google Apps Script by ChatWorkClient.'});
}
Reference
이 문제에 관하여(Google Apps Script에서 ChatWork API를 사용하여 게시), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/y_minowa/items/39db8ca5bffc9c440caf텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념
(Collection and Share based on the CC Protocol.)