Live canvas errors "Messenger App couldn’t be loaded"

#1

Morning Folks,

Working on an app, and the configure/initialise flows appear to work just fine when installing, and I can see from my server logs that Intercom is also making the additional request to get the content for the live_canvas returned by initialise.

Initialise Response:

{
	"canvas": {
		"content_url": "https://mydomain.com/content/url"
	}
}

The error I get simply says “Messenger App couldn’t be loaded” with little additional context, but my guess is that the JSON payload returned by my content_url isn’t right? My returned payload looks like this:

Response from content_url:

{
	"canvas": {
		"content": {
			"components": [{
				"type": "list",
				"items": [{
					"type": "item",
					"title": "Hello World!",
					"action": {
						"type": "url",
						"url": "http://example.com"
					}
				}]
			}]
		}
	}
}

I’ve also tried alternative options which omit ‘canvas’ and ‘content’, making the ‘components’ the root object, but I get the same results. I’ve confirmed that the content_url being hit by Intercom is returning 200 with a payload, so it’s not a server error.

Appreciate any help.

Robert

0 Likes

#2

Hey @robertrawlins :wave:

Looks like you need to add an id field to your list item there. Something such as this should work:

{
	"canvas": {
		"content": {
			"components": [{
				"type": "list",
				"items": [{
					"type": "item",
                    "id": "123",
					"title": "Hello World!",
					"action": {
						"type": "url",
						"url": "http://example.com"
					}
				}]
			}]
		}
	}
}

Let me know how you get on!

0 Likes

#3

Thanks Zach, I’ll give that a shot this afternoon and let you know how I get on. The docs seem to suggest that the “id” is optional though.

https://developers.intercom.com/messenger-framework-reference/reference#section-list-item

0 Likes

#4

Yeah that’s something we seemed to have missed here - I’ve updated it now to specify it as required :+1:

1 Like

#5

Great, I appreciate the quick reply! :+1:

Just to confirm before I start work, my content_url should return a complete ‘canvas’ payload, not just the ‘content’ or ‘components’ - correct?

0 Likes

#6

I’ve now added ID to the item object, however it still doesn’t appear to like the payload, I’m getting the same error as before.

{
	"canvas": {
		"content": {
			"components": [{
				"type": "list",
				"items": [{
					"type": "item",
					"id": "intercom_messenger_app_11",
					"title": "Hello World!",
					"action": {
						"type": "url",
						"url": "http://example.com"
					}
				}]
			}]
		}
	}
}

Any other suggestions as to why it might be unhappy?

0 Likes

#7

Zach was kind enough to reach out to me off-list so we could debug this. We determined that the content_url should NOT wrap it’s response in the ‘canvas’ envelope, and ‘content’ should be the root object.

I had tried this yesterday, but at that point we had the flaw in the list items docs so the ID attribute was missing.

These two issues are now fixed, and I’m back in the fight. :muscle:

0 Likes