New messenger app customer object missing in the request

I am creating a messenger app. As per the documentation I should have customer object in initialize request payload.

Like this:

workspace_id: "abcd123",
admin: { / Object: See link in table for the full model / },
conversation: { / Object: See link in table for the full model / },
customer: { / Object: See link in table for the full model / }

But in my end I am not having customer object. I am getting:

    workspace_id: "abcd123",
    card_creation_options: {},
    context: {},
    admin: { / Object: See link in table for the full model / }

Why I am not getting customer object in payload?

My app is still in the development mode. Its not live yet.
I have selected all in the permission section in the canvas kit.

Advance thanks for help.

Hey @awlad - you’re looking at the initialize request payload for apps that load in the Conversation Details panel (ie. Inbox).

For apps that are to be used by end users in the Messenger, when they’re added in any location, they’re technically not associated to any conversation or customer yet as they’ve not been sent. Hence, no customer object is given :+1:

@zach Thanks for clarify.

Do we have any event/hook when messenger app used in any conversation? I need to get customer email address when my messenger app is added in any conversation. Any way to accomplish this?

No problem - so when they’re added to a conversation, the context object will have the conversation_id as part of this. More on the context object here.

You can then use the conversation_id to make a query to our Conversations API and fetch that conversation. There will be a customers object with an array of customers that are associated the conversation - you can see the id and type of customer (whether it’s a lead or a user).

Depending on what type of customer it is, you can make a call to the Users API or Leads API and fetch the details of that customer to grab their email.