What's the point of "meta_data" on a Quick Reply Option?


#1

When I first started writing Twitter bots I thought that meta_data would be included in somewhere in the payload.

I just checked again and it’s not included anywhere in the payload that is delivered to the account activity webhook.

What’s the purpose of it? It’d be nice to use it!


#5

Hi @bobber205, what is the meta_data you are referring to?

The answer may be obvious, so apologies in advance if I am not thinking correctly.


#6

Good afternoon @joncipriano

When you specify a quick reply options there are two keys required: Label and “meta_data”.

If you leave it off there is an error. When supplied it never comes in any payload received.


#7

Hi @bobber205, the meta data “should” be returned when a user only selects a quick reply response. In the JSON object it should be at:

event.message_create.message_data.quick_reply_response.metadata

If it is not, someone on the team here can look into it.


#9

I just searched the last relevant json payload that was sent via a quick reply and there was no instance of the word “metadata” in it anywhere.


#10

Hi @bobber205, if you are able to, please share the JSON posted to send the quick reply and the JSON generated by the user replying by selecting a quick reply. Thanks.


#11

I’m trying to send quick_reply_response via https://api.twitter.com/1.1/direct_messages/events/new.json.
But the response is not populated in the response json.

Is responding back to quick reply options only allowed to official clients?

Here’s the log:
[Mon Aug 13 09:50:35 JST 2018]Request:
[Mon Aug 13 09:50:35 JST 2018]POST https://api.twitter.com/1.1/direct_messages/events/new.json
[Mon Aug 13 09:50:35 JST 2018]OAuth base string: POST&https%3A%2F%2Fapi.twitter.com%2F1.1%2Fdirect_messages%2Fevents%2Fnew.json&oauth_consumer_key%3DUF8zZg9gEX6msNx0WZn3mXx5U%26oauth_nonce%3D3107991648%26oauth_signature_method%3DHMAC-SHA1%26oauth_timestamp%3D1534121435%26oauth_token%3D1423387051-YYP8ifhdxbl1GcqwAllrE38lJCe6p48WCKnOLmO%26oauth_version%3D1.0
[Mon Aug 13 09:50:35 JST 2018]OAuth signature: 8+XDIt/vgzhiNA5RGBdrOyIKKBg=
[Mon Aug 13 09:50:35 JST 2018]Authorization: ***************************************************************************************************************************************************************************************************************************************************************************************
[Mon Aug 13 09:50:35 JST 2018]X-Twitter-Client-Version: 4.0.7-SNAPSHOT
[Mon Aug 13 09:50:35 JST 2018]X-Twitter-Client-URL: http://twitter4j.org/en/twitter4j-4.0.7-SNAPSHOT.xml
[Mon Aug 13 09:50:35 JST 2018]X-Twitter-Client: Twitter4J
[Mon Aug 13 09:50:35 JST 2018]User-Agent: twitter4j http://twitter4j.org/ /4.0.7-SNAPSHOT
[Mon Aug 13 09:50:35 JST 2018]Accept-Encoding: gzip
[Mon Aug 13 09:50:35 JST 2018]Post Params: {“event”:{“type”:“message_create”,“message_create”:{“target”:{“recipient_id”:96372623},“message_data”:{“text”:“label2”,“quick_reply_response”:{“type”:“options”,“metadata”:“metadata2”}}}}}
[Mon Aug 13 09:50:35 JST 2018]Response:
[Mon Aug 13 09:50:35 JST 2018]date: Mon, 13 Aug 2018 00:50:35 GMT
[Mon Aug 13 09:50:35 JST 2018]HTTP/1.1 200 OK
[Mon Aug 13 09:50:35 JST 2018]server: tsa_m
[Mon Aug 13 09:50:35 JST 2018]content-length: 203
[Mon Aug 13 09:50:35 JST 2018]x-tsa-request-body-time: 0
[Mon Aug 13 09:50:35 JST 2018]expires: Tue, 31 Mar 1981 05:00:00 GMT
[Mon Aug 13 09:50:35 JST 2018]x-response-time: 173
[Mon Aug 13 09:50:35 JST 2018]x-frame-options: SAMEORIGIN
[Mon Aug 13 09:50:35 JST 2018]content-encoding: gzip
[Mon Aug 13 09:50:35 JST 2018]x-transaction: 00c76ab500f7bec0
[Mon Aug 13 09:50:35 JST 2018]strict-transport-security: max-age=631138519
[Mon Aug 13 09:50:35 JST 2018]pragma: no-cache
[Mon Aug 13 09:50:35 JST 2018]set-cookie: guest_id=v1%3A153412143540022523; Expires=Wed, 12 Aug 2020 00:50:35 GMT; Path=/; Domain=.twitter.com
[Mon Aug 13 09:50:35 JST 2018]set-cookie: lang=en; Path=/
[Mon Aug 13 09:50:35 JST 2018]set-cookie: personalization_id=“v1_wbQVzaeeJWdpp4V26m6soA==”; Expires=Wed, 12 Aug 2020 00:50:35 GMT; Path=/; Domain=.twitter.com
[Mon Aug 13 09:50:35 JST 2018]last-modified: Mon, 13 Aug 2018 00:50:35 GMT
[Mon Aug 13 09:50:35 JST 2018]x-xss-protection: 1; mode=block; report=https://twitter.com/i/xss_report
[Mon Aug 13 09:50:35 JST 2018]x-content-type-options: nosniff
[Mon Aug 13 09:50:35 JST 2018]content-disposition: attachment; filename=json.json
[Mon Aug 13 09:50:35 JST 2018]x-connection-hash: c2a2b6dddf91817c04c5772b03091f6f
[Mon Aug 13 09:50:35 JST 2018]x-access-level: read-write
[Mon Aug 13 09:50:35 JST 2018]x-twitter-response-tags: BouncerCompliant
[Mon Aug 13 09:50:35 JST 2018]content-type: application/json;charset=utf-8
[Mon Aug 13 09:50:35 JST 2018]cache-control: no-cache, no-store, must-revalidate, pre-check=0, post-check=0
[Mon Aug 13 09:50:35 JST 2018]status: 200 OK
[Mon Aug 13 09:50:35 JST 2018]{“event”:{“type”:“message_create”,“id”:“1028805983491899397”,“created_timestamp”:“1534121435412”,“message_create”:{“target”:{“recipient_id”:“96372623”},“sender_id”:“1423387051”,“message_data”:{“text”:“label2”,“entities”:{“hashtags”:[],“symbols”:[],“user_mentions”:[],“urls”:[]}}}}}

[Mon Aug 13 09:50:35 JST 2018]{
“event”: {
“type”: “message_create”,
“id”: “1028805983491899397”,
“created_timestamp”: “1534121435412”,
“message_create”: {
“target”: {
“recipient_id”: “96372623”
},
“sender_id”: “1423387051”,
“message_data”: {
“text”: “label2”,
“entities”: {
“hashtags”: [],
“symbols”: [],
“user_mentions”: [],
“urls”: []
}
}
}
}
}


#12

Here’s the full log:
https://pastebin.com/eRPwUyEW


#13

You just have to use the label text to do your matching not the meta data. Unless I am misunderstanding your question.

Also you should create a new thread.