Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/junker/gapi
Google API client for Common Lisp.
https://github.com/junker/gapi
common-lisp google-api google-cloud google-cloud-api google-cloud-apis
Last synced: 9 days ago
JSON representation
Google API client for Common Lisp.
- Host: GitHub
- URL: https://github.com/junker/gapi
- Owner: Junker
- Created: 2024-07-17T16:09:42.000Z (6 months ago)
- Default Branch: master
- Last Pushed: 2024-07-24T14:10:35.000Z (6 months ago)
- Last Synced: 2024-11-08T13:22:45.468Z (2 months ago)
- Topics: common-lisp, google-api, google-cloud, google-cloud-api, google-cloud-apis
- Language: Common Lisp
- Homepage:
- Size: 5.86 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 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](https://ultralisp.org/) like this:
```common-lisp
(ql-dist:install-dist "http://dist.ultralisp.org/"
:prompt nil)
(ql:quickload "gapi")
```## Usage
```common-lisp
(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* (format nil
"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*
(list :|token| *token*
:|notification| (list :|title| "Message Title"
:|body| "Message body")))
(gapi:request *client* (format nil "https://fcm.googleapis.com/v1/projects/~A/messages:send"
*project-id*)
:method :POST :data (list :|message| *message*));;etc
```## Documentation
- [Google APIs Explorer](https://developers.google.com/apis-explorer)