Skip to content

Latest commit

History

10 Commits

Folders and files

NameName
Last commit message
Last commit date

Repository files navigation

GAPI

Google API client for Common Lisp.

Warning

This software is still ALPHA quality. The APIs will be likely to change.

Installation

This system can be installed from UltraLisp like this:

(ql-dist:install-dist "http://dist.ultralisp.org/":promptnil)
(ql:quickload "gapi")

Usage

(defvar*service-file*"/myproject/config/google-service.json")
;; Translate
(defparameter*client*
(gapi:make-client-with-service-account
*service-file*:scopes'("https://www.googleapis.com/auth/cloud-translation")))
(defparameter*project-id* (gapi:client-project-id *client*))
(gapi:auth *client*)
(gapi:request *client* (formatnil"https://translate.googleapis.com/v3beta1/projects/~A:detectLanguage"*project-id*)
:method:POST:payload'(:|content| "Hello"))
;; => (:|languages| ((:|confidence| 1 :|languageCode| "en")));; FCM
(defparameter*client*
(gapi:make-client-with-service-account
*service-file*:scopes'("https://www.googleapis.com/auth/firebase.messaging")))
(defparameter*project-id* (gapi:client-project-id *client*))
(gapi:auth *client*)
(defvar*message*`(:|token| ,*token*
:|notification| (:|title| "Message Title"
:|body| "Message body")))
(gapi:request *client* (formatnil"https://fcm.googleapis.com/v1/projects/~A/messages:send"*project-id*)
:method:POST:payload (list :|message| *message*))
;;etc

Documentation

About

Google API client for Common Lisp.

Topics

Resources

Stars

4 stars

Watchers

1 watching

Forks

Releases

Contributors

Languages