I got a string in this form
payload = ["Text 1", "Text 2"]
I want to use Text 2 as an object. How can I return it?
UPDATE
I'm making a function which returns a generic template Facebook API.
The first payload works well, but I want to return a string and a object in the second payload ( result )
button = [
{
"type": "postback",
"title": "Buy item",
"payload": "Buy this item: " + (product['id'])
},
{
"type": "postback",
"title": "Add to wishlist",
"payload": result
}
]
My second payload should look like this:
payload = {
'Order_item',
product['title']
}
Because I got this error [buttons][1][payload] must be a UTF-8 encoded string so I did convert it and it returns a STRING in this form ["Order_item", "Ledverlichting Fiets Blauw"]
Because I want that when a Facebook user clicks on a postback ( Add to wishlist ), the product['title'] value will be save in Django database. And product['title'] is the Text 2 in the question above.
payload[1]? you want an array of 1 string? can you be more specific?