Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

With GMail API, Is it possible to insert message to INBOX?

Tags:

gmail-api

With GMail API, it is possible to insert a message to inbox with https://developers.google.com/gmail/api/v1/reference/users/messages/insert

The problem I face is when using insert, messages do not appear in INBOX and user has to go to 'All Mail' in order to see them.

What is the best way to insert messages into INBOX? Import?

like image 389
Marcin Avatar asked Oct 22 '25 06:10

Marcin


1 Answers

You can set the request body based from the documentation:

Request Body: {
   "raw": "string" // required property
   "labelIds": "["INBOX"]" // add this optional property
   "threadId": "string"
}

Here's the complete list for Type of Message labels.

like image 199
Jessica Rodriguez Avatar answered Oct 26 '25 14:10

Jessica Rodriguez