mirror of
https://github.com/tloncorp/landscape.git
synced 2024-12-24 01:03:38 +03:00
fa17f1af9a
Implements the health check call as described here: https://mailchimp.com/developer/transactional/guides/quick-start/#make-your-first-api-call The Production API key is stored in 1password under Tlon Hosting > Mailchimp Transactional API key
47 lines
985 B
Plaintext
47 lines
985 B
Plaintext
:: Mailchimp/Ping
|
|
:: a health check endpoint for the Mailchimp Transactional API
|
|
::
|
|
:: > -bark!mailchimp-ping "[API_KEY]"
|
|
:: "PONG!"
|
|
::
|
|
/- spider
|
|
/+ *strandio
|
|
=, strand=strand:spider
|
|
=, dejs:format
|
|
=/ m (strand ,vase)
|
|
|^ ted
|
|
++ api-post
|
|
|= api-key=tape
|
|
%: send-request
|
|
method=%'POST'
|
|
url=url
|
|
header-list=['Content-Type'^'application/json' ~]
|
|
^= body
|
|
%- some %- as-octt:mimes:html
|
|
%- en-json:html
|
|
%- pairs:enjs:format
|
|
:~ ['key' s+(crip api-key)]
|
|
==
|
|
==
|
|
++ url 'https://mandrillapp.com/api/1.0/users/ping'
|
|
++ ted
|
|
^- thread:spider
|
|
|= arg=vase
|
|
=/ m (strand ,vase)
|
|
^- form:m
|
|
=/ arg-mold
|
|
$: api-key=tape
|
|
==
|
|
=/ args !<((unit arg-mold) arg)
|
|
?~ args
|
|
(pure:m !>(~))
|
|
;< ~ bind:m (api-post api-key.u.args)
|
|
;< rep=client-response:iris bind:m
|
|
take-client-response
|
|
?> ?=(%finished -.rep)
|
|
?~ full-file.rep !!
|
|
=/ body=cord q.data.u.full-file.rep
|
|
%- pure:m
|
|
!> [body ~]
|
|
--
|