Cross shared collection | Cenit Admin

Basic info

Image
Name
gmail
Tags
Summary
A Gmail API Wrapper
Readme

Quick Start

To try your Gmail Collection:

1. Authorize your Gmail API OAuth 2.0 authorization, if you have not done so.

2. Create a new MIME Message.

And that's all, the message you created have been sent using your authorized Google account.

Using CenitHub API

MIME messages are available at https://cenit.io/api/v1/mime/message.

To POST a message to this URL just format a JSON document like this

{
  "to": "support@cenit.io",
  "subject": "Hello",
  "body": "Just to say hello!",
  "attachments": [
    {
      "filename": "file.txt",
      "data": "Sent through CenitHub API"
    }
  ]
}

You can try it with the following CURL command

curl -H "Content-Type: application/json"\
     -H "X-User-Access-Key: XXXXXXX"\
     -H "X-User-Access-Token: XXXXXXXXXXXXXXXX"\
     -X POST -d '{"to":"support@cenit.io","subject":"Hello","body":"Just to say hello!","attachments":[{"filename":"file.txt","data":"Sent through CenitHub API"}]}'\
     https://cenit.io/api/v1/mime/message

You can POST messages also in XML format

<?xml version="1.0"?>
<Message>
  <to>support@cenit.io</to>
  <subject>Hello</subject>
  <body>Just to say hello!</body>
  <Attachment>
    <filename>file.txt</filename>
    <data>Sent through CenitHub API</data>
  </Attachment>
</Message>

If you want to attach binary files you can encode them and specify the encoding format like this

{
  "to": "support@cenit.io",
  "subject": "See attachment",
  "attachments": [
    {
      "filename": "file.txt",
      "encoding": "urlsafe_base64",
      "data": "U2VudCB0aHJvdWdoIENlbml0SHViIEFQSQ=="
    }
  ]
}

The availables encoding formats are

- base64

- strict_base64

- urlsafe_base64

About Attachments

Attachments are stored in a separate file data type and they are available at https://cenit.io/api/v1/mime/attachment. If you have the ID of a file already stored on that model then you can attach it to a message by simple reference

{
  "to": "support@cenit.io",
  "subject": "See attachment",
  "attachments": [
    {
      "_reference": true,
      "id": "abcoie90w344965n56n54nm6"
    }
  ]
}

Note that the 'attachments' property value is an array, so you can attach more than one file.

Restful API

You have a complete set of actions over your data in Cenit.

Retrieve a list of messages

curl -H "Content-Type: application/json"\
     -H "X-User-Access-Key: XXXXXXX"\
     -H "X-User-Access-Token: XXXXXXXXXXXXXXXX"\
     -X GET https://cenit.io/api/v1/mime/message

Show a message by id

curl -H "Content-Type: application/json"\
     -H "X-User-Access-Key: XXXXXXX"\
     -H "X-User-Access-Token: XXXXXXXXXXXXXXXX"\
     -X GET https://cenit.io/api/v1/mime/message/XXXXXXXXXXXXXXX
Categories
IdTitleDescriptionUpdated at
emailEmailElectronic mail services including storage, delivery and analysisDecember 01, 2016 17:06
1 Categories
Authors
Name
Cenithub Team
1 Cross collection authors
Pull count
101
Id
57b62751ad981536c10001f1
Created at
August 18, 2016 21:23
Updated at
December 01, 2016 17:18

Compute

Translators
NamespaceNameTypeStyleMime typeFile extensionUpdated at
GmailMIME To Gmail API V1 MessageExportrubyapplication/jsonjsonOctober 27, 2016 15:52
1 Transformations
Algorithms
NamespaceNameDescriptionLanguageTagsUpdated at
MIMEto_rfc822Convert a message into a RFC822 formatRuby
March 28, 2017 20:35
1 Algorithms
Snippets
NamespaceNameTypeDescriptionCode
GmailMIME_To_Gmail_API_V1_Message.rbRuby -
MIMEMessage.jsonJavaScript -
MIMEto_rfc822.rbRuby -
3 Snippets

Workflows

Flows
NamespaceNameActiveEventTranslatorUpdated at
GmailSend Created MessageGmail | MIME To Gmail API V1 Message [Shared]October 27, 2016 17:01
1 Flows
Events
NamespaceNameTypeUpdated at
MIMEMessage CreatedObserver -
1 Events

Connectors

Connections
NamespaceNameUrlKeyTokenAuthorizationUpdated at
Gmail API v1Connectionhttps://www.googleapis.com/gmail/v1/usersQShu6PsgK5gGFMeruKohSeptember 21, 2016 14:46
1 Connections
Webhooks
NamespaceNamePathMethodDescriptionAuthorizationUpdated at
Gmail API v1POST {userid} Messages Send/{{userId}}/messages/sendpostSends the specified message to the recipients in the To, Cc, and Bcc headers.October 27, 2016 18:37
1 Webhooks
Connection Roles
NamespaceNameWebhooksConnectionsUpdated at
GmailConnectionsGmail API v1 | Connection [Shared] -
1 Connection Roles

Data

Data Types
NamespaceNameSlugTypeStorage sizeUpdated at
MIMEAttachmentattachmentFile Data Type0 BytesSeptember 20, 2016 21:00
MIMEMessagemessageJson Data Type0 BytesApril 18, 2017 14:32
2 Data Types

Security

Authorizations
NamespaceNameStatusTypeUpdated at
GmailAPI v1 AuthorizationUnauthorizedOauth 2 Authorization -
1 Authorizations
OAuth Clients
ProviderNameIdentifierSecretUpdated at
Cenit | Google [Shared]CenitSaaSFebruary 23, 2017 18:24
1 Remote OAuth Clients
OAuth Providers
NamespaceNameTypeResponse typeAuthorization endpointToken endpointToken methodUpdated at
CenitGoogleOauth 2 Providercodehttps://accounts.google.com/o/oauth2/authhttps://accounts.google.com/o/oauth2/tokenPOSTFebruary 23, 2017 18:24
1 Providers
OAuth 2.0 Scopes
ProviderNameDescriptionUpdated at
Cenit | Google [Shared]https://www.googleapis.com/auth/gmail.sendSend email on your behalfJuly 31, 2017 22:54
1 OAuth 2.0 Scopes

Config

Namespaces
NameSlugUpdated at
MIMEmime -
Gmail API v1gmail_api_v1 -
Gmailgmail -
Cenitcenit -
4 Namespaces

Metadata