@@ -22,30 +22,35 @@ This system can be installed from [UltraLisp](https://ultralisp.org/) like this:
22
22
(defvar *service-file* "/myproject/config/google-service.json")
23
23
24
24
;; Translate
25
- (defparameter *client* (gapi:make-client-with-service-account service-file
26
- :scopes '("https://www.googleapis.com/auth/cloud-translation")))
25
+ (defparameter *client*
26
+ (gapi:make-client-with-service-account
27
+ service-file :scopes '("https://www.googleapis.com/auth/cloud-translation")))
27
28
(defparameter *project-id* (gapi:client-project-id *client*))
28
29
(gapi:auth *client*)
29
- (gapi:request *client* (format nil "https://translate.googleapis.com/v3beta1/projects/~A:detectLanguage" *project-id*)
30
+ (gapi:request *client* (format nil
31
+ "https://translate.googleapis.com/v3beta1/projects/~A:detectLanguage"
32
+ *project-id*)
30
33
:method :POST :payload '(:|content| "Hello"))
31
34
;; => (:|languages| ((:|confidence| 1 :|languageCode| "en")))
32
35
33
36
34
37
;; FCM
35
- (defparameter *client* (gapi:make-client-with-service-account service-file
36
- :scopes '("https://www.googleapis.com/auth/firebase.messaging")))
38
+ (defparameter *client*
39
+ (gapi:make-client-with-service-account
40
+ service-file :scopes '("https://www.googleapis.com/auth/firebase.messaging")))
37
41
(defparameter *project-id* (gapi:client-project-id *client*))
38
42
(gapi:auth *client*)
39
43
(defvar *message*
40
44
(list :|token| *token*
41
45
:|notification| (list :|title| "Message Title"
42
46
:|body| "Message body")))
43
- (gapi:request *client* (format nil "https://fcm.googleapis.com/v1/projects/~A/messages:send" *project-id*)
47
+ (gapi:request *client* (format nil "https://fcm.googleapis.com/v1/projects/~A/messages:send"
48
+ *project-id*)
44
49
:method :POST :data (list :|message| *message*))
45
50
46
-
47
- etc
51
+ ;;etc
48
52
```
49
53
50
54
## Documentation
51
55
56
+ - [ Google APIs Explorer] ( https://developers.google.com/apis-explorer )
0 commit comments