購読
このグループのすべてのオペレーションの、受け付ける内容、返す内容、返しうるエラー。
オペレーション
Newsletters and mailing lists the mailbox receives, found from the List-Unsubscribe header of the mail they send, as the Subscriptions page of the app shows them. Unsubscribe from one sender or a whole domain, or move what they sent and keep moving what they send.
GET/subscriptions
List subscriptions
One row per sender and address it writes to, with how much mail it sent, how much of it is unread and how much arrived in the last 30 days. A key or an app limited to particular addresses lists only the subscriptions delivered to them.
Requires the threads:read scope.
クエリパラメーター
statusstringactivelists what still arrives,unsubscribedwhat you left.次のいずれか"active""unsubscribed"既定値"active"qstringSearches the sender name and address.
200文字までsortstringrecentputs the newest mail first,mostthe senders with the most mail,unreadthose with the most unread,namesorts by sender.次のいずれか"recent""most""unread""name"既定値"recent"limitintegerRows per page.
1以上200以下既定値50offsetintegerHow many rows to skip, for the next page.
0以上既定値0addressstringOnly the subscriptions delivered to this address. One the key does not reach lists nothing.
3〜320文字
戻り値
A page of subscriptions.
エラー
どのオペレーションも返しうるエラー400401403404422500エラー一覧
ほかの提供先
GET/subscriptions/domains
List subscriptions by domain
The same subscriptions, one row per sender domain with the counts of its senders added up, so a company that writes from several addresses is one row.
Requires the threads:read scope.
クエリパラメーター
statusstringactivelists what still arrives,unsubscribedwhat you left.次のいずれか"active""unsubscribed"既定値"active"qstringSearches the sender name and address.
200文字までsortstringrecentputs the newest mail first,mostthe senders with the most mail,unreadthose with the most unread,namesorts by sender.次のいずれか"recent""most""unread""name"既定値"recent"limitintegerRows per page.
1以上200以下既定値50offsetintegerHow many rows to skip, for the next page.
0以上既定値0addressstringOnly the subscriptions delivered to this address. One the key does not reach lists nothing.
3〜320文字
戻り値
A page of sender domains.
エラー
どのオペレーションも返しうるエラー400401403404422500エラー一覧
ほかの提供先
POST/subscriptions/domains/{domain}/unsubscribe
Unsubscribe from a whole domain
Unsubscribes from every sender on the domain that can be unsubscribed without a person opening a page, with one-click or by email. skipped counts the senders that only offer a page, and failed the ones that did not accept it. Unsubscribing works the way the sender asks for it: a one-click request to its unsubscribe address when it offers one, an unsubscribe email from the address the mail arrived at when it gives a mailto, and otherwise the sender's own unsubscribe page in url, which a person has to open. method says which.
Requires the threads:write scope.
パスパラメーター
domainstring必須The sender domain, as
GET /subscriptions/domainsreturns it.
リクエストボディ
binbooleanAlso move every conversation from the senders to the Bin.
既定値falseaddressstringOnly the subscriptions delivered to this address.
3〜320文字
戻り値
What happened to each sender, counted.
エラー
どのオペレーションも返しうるエラー400401403404422500エラー一覧
ほかの提供先
POST/subscriptions/{id}/unsubscribe
Unsubscribe from a sender
Unsubscribing works the way the sender asks for it: a one-click request to its unsubscribe address when it offers one, an unsubscribe email from the address the mail arrived at when it gives a mailto, and otherwise the sender's own unsubscribe page in url, which a person has to open. method says which. With bin, every conversation from the sender also moves to the Bin.
Requires the threads:write scope.
パスパラメーター
idstring必須The subscription, as
GET /subscriptionsreturns it.
リクエストボディ
binbooleanAlso move every conversation from the sender to the Bin.
既定値false
戻り値
How it was unsubscribed.
エラー
- 422
unsubscribe_unsupported: the sender gives no way to unsubscribe.- 502
unsubscribe_refused: the sender did not accept the one-click request and gives no address to write to.
どのオペレーションも返しうるエラー400401403404500エラー一覧
ほかの提供先
POST/subscriptions/{id}/move
Move what a sender sent
Moves every conversation from the sender to the archive, the Bin or a label. With future, the default, a rule keeps doing it to new mail from the sender to that address, which also needs rules:write. future: false drops a rule made that way before.
Requires the threads:write scope.
パスパラメーター
idstring必須The subscription, as
GET /subscriptionsreturns it.
リクエストボディ
destinationstring必須archive,binorlabel.次のいずれか"archive""bin""label"labelIdstringThe label to file under when
destinationislabel.null も可1〜200文字futurebooleanAlso keep doing it to new mail from the sender, with a rule. Needs
rules:write.既定値trueruleNamestringA name for that rule.
null も可100文字まで
戻り値
How many conversations moved, and the rule.
エラー
どのオペレーションも返しうるエラー400401403404422500エラー一覧
ほかの提供先
POST/threads/{id}/unsubscribe
Unsubscribe from the sender of a thread
The Unsubscribe button of the reading pane: finds the subscription behind the newest message of the thread that carries a List-Unsubscribe header and unsubscribes from it. Unsubscribing works the way the sender asks for it: a one-click request to its unsubscribe address when it offers one, an unsubscribe email from the address the mail arrived at when it gives a mailto, and otherwise the sender's own unsubscribe page in url, which a person has to open. method says which.
Requires the threads:write scope.
パスパラメーター
idstring必須The thread, as
GET /threadsreturns it.
戻り値
How it was unsubscribed.
エラー
- 422
unsubscribe_unsupported: the sender gives no way to unsubscribe.- 502
unsubscribe_refused: the sender did not accept the one-click request and gives no address to write to.
どのオペレーションも返しうるエラー400401403404500エラー一覧
ほかの提供先
オブジェクト
DomainUnsubscribeResultobject
objectstring- 次のいずれか
"domain_unsubscribe" domainstringunsubscribedintegerskippedintegerSenders that only offer a page.
failedintegerbinnedinteger
Subscriptionobject
objectstring- 次のいずれか
"subscription" idstringsenderEmailstringsenderNamestring- null も可
recipientstringThe address the mail arrives at.
statusstring- 次のいずれか
"active""unsubscribed" methodstringHow the sender lets you unsubscribe, or null when it gives no way.
null も可次のいずれか"one-click""email""link"linkUrlstringIts unsubscribe page, when it has one.
null も可unreadintegerrecentintegerMail in the last 30 days.
totalintegersinceUnsubscribedintegerMail that still arrived after you unsubscribed.
lastSeenAtstring- 形式
date-time unsubscribedAtstring- null も可形式
date-time unsubscribedWithstring- null も可次のいずれか
"one-click""email""link" futureobjectThe rule that keeps moving its new mail, when there is one.
null も可ruleIdstringdestinationstring- 次のいずれか
"archive""bin""label" labelIdstring- null も可
SubscriptionDomainobject
objectstring- 次のいずれか
"subscription_domain" domainstringnamestringsampleEmailstringOne sender address on the domain.
sendersintegerunsubscribableintegerSenders that can be unsubscribed without a person opening a page.
unreadintegerrecentintegertotalintegersinceUnsubscribedintegerlastSeenAtstring- 形式
date-time
SubscriptionDomainListobject
objectstring- 次のいずれか
"list" totalintegercountsobjectactiveintegerunsubscribedinteger
hasMoreboolean
SubscriptionListobject
objectstring- 次のいずれか
"list" dataSubscription[]totalintegerRows that match, across every page.
countsobjectactiveintegerunsubscribedinteger
hasMoreboolean
SubscriptionMoveResultobject
objectstring- 次のいずれか
"subscription_move" subscriptionIdstringmovedintegerConversations moved.
ruleIdstringThe rule that keeps moving new mail.
null も可
UnsubscribeResultobject
objectstring- 次のいずれか
"unsubscribe" subscriptionIdstringthreadIdstringPresent when it was asked for through a thread.
methodstring- 次のいずれか
"one-click""email""link" urlstringThe page to open when
methodislink, since that one needs a person.null も可binnedintegerConversations moved to the Bin.