How can I get read receipts from LinkedIn Voyager API? - linkedin

I want to see if the last message has been seen by the person who I have sent the message to. I have got 20 conversation back from hitting this endpoint:
https://www.linkedin.com/voyager/api/messaging/conversations
I am using JSessions and cookies to authenticate. This is one of the conversations I got back:
{
"notificationStatus": "ACTIVE",
"read": true,
"groupChat": false,
"totalEventCount": 27,
"unreadCount": 0,
"lastActivityAt": 1613499552905,
"firstMessageUrn": "urn:li:fs_event:(6408489350996336640,S6408489350996336640_500)",
"backendUrn": "urn:li:messagingThread:2-MDYyMDFmMTUtMzk5NS01MTg2LWE1YWMtYzc2Y2JlYzNjYjE1XzAwMA==",
"receipts": [
{
"fromEntity": "urn:li:fs_miniProfile:ACoAACCRRgUBTOJXdRefeTMNta2hGPxadGDnNrA",
"seenReceipt": {
"seenAt": 1613498927377,
"eventUrn": "urn:li:fs_event:(6408489350996336640,S6767504989536559104_500)"
},
"fromParticipant": {
"string": "urn:li:member:546391557"
}
}
],
"archived": false,
"blocked": false,
"entityUrn": "urn:li:fs_conversation:6408489350996336640",
"viewerCurrentParticipant": true,
"featureTypes": [
"REACTIONS",
"CREATE_NEW_GROUP_CHAT"
],
"withNonConnection": false,
"muted": false,
"events": [
{
"createdAt": 1613499552888,
"reactionSummaries": [],
"dashEntityUrn": "urn:li:fsd_message:S6767507628659757056_500",
"quickReplyRecommendations": [],
"entityUrn": "urn:li:fs_event:(6408489350996336640,S6767507628659757056_500)",
"eventContent": {
"com.linkedin.voyager.messaging.event.MessageEvent": {
"messageBodyRenderFormat": "DEFAULT",
"body": "",
"attributedBody": {
"text": "some more text"
}
}
},
"subtype": "MEMBER_TO_MEMBER",
"from": {
"com.linkedin.voyager.messaging.MessagingMember": {
"miniProfile": {
"memorialized": false,
"firstName": "Sepideh",
"lastName": "Falah",
"occupation": "Software Engineer at SocialCycle",
"objectUrn": "urn:li:member:192299229",
"entityUrn": "urn:li:fs_miniProfile:ACoAAAt2QN0ByntmuEeEZB7874UZ84rt5wR4sL4",
"publicIdentifier": "sepideh-falah-33949854",
"picture": {
"com.linkedin.common.VectorImage": {
"artifacts": [
{
"width": 100,
"fileIdentifyingUrlPathSegment": "100_100/0/1516745437487?e=1619049600&v=beta&t=WXbHMyBCelbHjHoWSEVbi4TydR7qMeehH15FWpJYIao",
"expiresAt": 1619049600000,
"height": 100
},
{
"width": 200,
"fileIdentifyingUrlPathSegment": "200_200/0/1516745437487?e=1619049600&v=beta&t=66x3s8Hw5BvedUqu1RZ2TNazf2o0y9amUAJbKIx2nLI",
"expiresAt": 1619049600000,
"height": 200
},
{
"width": 400,
"fileIdentifyingUrlPathSegment": "400_400/0/1516745437487?e=1619049600&v=beta&t=MM1mHaQP6KTfNgJRIEuPQ0_2l76eA-DQbt0v4SiVs-0",
"expiresAt": 1619049600000,
"height": 400
},
{
"width": 800,
"fileIdentifyingUrlPathSegment": "800_800/0/1516745437487?e=1619049600&v=beta&t=YW7bUQO8Vpext2at7SW5FQhuot81Xk1HCnbJ_2jdjAI",
"expiresAt": 1619049600000,
"height": 800
}
],
"rootUrl": "https://media-exp1.licdn.com/dms/image/C5103AQEJ4t5ijWZ8Xg/profile-displayphoto-shrink_"
}
},
"trackingId": "ZJXqw5fwRdCZPQpx0d1yhw=="
},
"entityUrn": "urn:li:fs_messagingMember:(6408489350996336640,ACoAAAt2QN0ByntmuEeEZB7874UZ84rt5wR4sL4)",
"nameInitials": "SF"
}
},
"previousEventInConversation": "urn:li:fs_event:(6408489350996336640,S6767504989536559104_500)",
"originToken": "07ea6a5d-7450-4a22-b5f4-ceb599e16ab4",
"backendUrn": "urn:li:messagingMessage:2-MTYxMzQ5OTU1MjY4NGI3NTYwOS0wMDEmMDYyMDFmMTUtMzk5NS01MTg2LWE1YWMtYzc2Y2JlYzNjYjE1XzAwMA=="
}
],
"participants": [
{
"com.linkedin.voyager.messaging.MessagingMember": {
"miniProfile": {
"memorialized": false,
"firstName": "Trevor",
"lastName": "Johnson",
"occupation": "Software Developer at Axway",
"objectUrn": "urn:li:member:546391557",
"entityUrn": "urn:li:fs_miniProfile:ACoAACCRRgUBTOJXdRefeTMNta2hGPxadGDnNrA",
"publicIdentifier": "johnson-trevor",
"picture": {
"com.linkedin.common.VectorImage": {
"artifacts": [
{
"width": 100,
"fileIdentifyingUrlPathSegment": "100_100/0/1524789372523?e=1619049600&v=beta&t=9ystm3UQKcVGh6sc5OYOkc8NjA0KzGwo9XRrNOYZOJo",
"expiresAt": 1619049600000,
"height": 100
},
{
"width": 200,
"fileIdentifyingUrlPathSegment": "200_200/0/1524789372523?e=1619049600&v=beta&t=nIqjHKqUN9N2_cXGfG4iDcfxjJkC7DGGDKD_yawbm40",
"expiresAt": 1619049600000,
"height": 200
},
{
"width": 400,
"fileIdentifyingUrlPathSegment": "400_400/0/1524789372523?e=1619049600&v=beta&t=l1fwjGmn-cxqwc5S-1IF5Y1HWg99akHkUQt3caorZPA",
"expiresAt": 1619049600000,
"height": 400
},
{
"width": 800,
"fileIdentifyingUrlPathSegment": "800_800/0/1524789372523?e=1619049600&v=beta&t=pj8u5JMqmLVuEFKNSbPT8fg7UfXTDE82wsJ6Uc6Urio",
"expiresAt": 1619049600000,
"height": 800
}
],
"rootUrl": "https://media-exp1.licdn.com/dms/image/C5603AQGDs9cCCR0HSw/profile-displayphoto-shrink_"
}
},
"trackingId": "Yvzot8irQWmbRWKMpIRKKg=="
},
"entityUrn": "urn:li:fs_messagingMember:(6408489350996336640,ACoAACCRRgUBTOJXdRefeTMNta2hGPxadGDnNrA)",
"nameInitials": "TJ"
}
}
]
}

Append conversationUrn to the link you are using.
I see that "entityUrn": "urn:li:fs_conversation:6408489350996336640"
In that case URL will be:
https://www.linkedin.com/voyager/api/messaging/conversations/6408489350996336640/events
It will return you the list of messages (events) from 1 specified above conversation with details of every message.
BTW, it's interesting that in your case conversationUrn is 6408489350996336640. Usually it looks like 2-MGQxMGNkMTctNGIxOS00N2RhLTgyMmUtNDE0MzAyYjI1ODRkXzAxMg==

Related

Nextjs 13 displaying an Image

I am using the experimental app version of Nextjs 13.
My next.config.js looks like this:
/** #type {import('next').NextConfig} */
const nextConfig = {
experimental: {
appDir: true,
},
images: {
remotePatterns: [
{
protocol: 'http',
hostname: '127.0.0.1',
port: '1337',
pathname: '/api/**',
},
],
},
};
module.exports = nextConfig;
I make the following call to display an image on the screen:
<Image className='mt-2'
src={movie.data.attributes.image.data.attributes.url}
alt={movie.data.attributes.title}
width={500}
height={350}
/>
</div>
On the server side I am getting the following response:
The requested resource isn't a valid image for /uploads/2008_Jaden_3c49c0fe45.jpg received text/html; charset=utf-8
The image name is correct. And the title displayed is also correct.
It seems that the system is still pointing to the local folder /uploads instead of to the remote host that I configured in the next.config.js file.
I have tried and changed many things but I am unable to display the images. Hopefully someone can help me out?
Robert
I am using the following version:
Next.js 13.1.6
React 18.0.27
And for my backend
Strapi 4.6.1
The Strapi API route looks like this:
// 20230217152302
// http://127.0.0.1:1337/api/movies?populate=*
{
"data": [
{
"id": 1,
"attributes": {
"createdAt": "2023-02-03T15:39:55.796Z",
"updatedAt": "2023-02-07T11:39:47.652Z",
"publishedAt": "2023-02-03T15:40:08.569Z",
"title": "Lord of the Rings",
"year": 2001,
"description": "A meek Hobbit from the Shire and eight companions set out on a journey to destroy the powerful One Ring and save Middle-earth from the Dark Lord Sauron",
"slug": "lord-of-the-rings",
"image": {
"data": {
"id": 3,
"attributes": {
"name": "6FDUBGB.jpg",
"alternativeText": null,
"caption": null,
"width": 2000,
"height": 2496,
"formats": {
"thumbnail": {
"name": "thumbnail_6FDUBGB.jpg",
"hash": "thumbnail_6_FDUBGB_f8b45dbbae",
"ext": ".jpg",
"mime": "image/jpeg",
"path": null,
"width": 125,
"height": 156,
"size": 8.49,
"url": "/uploads/thumbnail_6_FDUBGB_f8b45dbbae.jpg"
},
"small": {
"name": "small_6FDUBGB.jpg",
"hash": "small_6_FDUBGB_f8b45dbbae",
"ext": ".jpg",
"mime": "image/jpeg",
"path": null,
"width": 401,
"height": 500,
"size": 62.75,
"url": "/uploads/small_6_FDUBGB_f8b45dbbae.jpg"
},
"medium": {
"name": "medium_6FDUBGB.jpg",
"hash": "medium_6_FDUBGB_f8b45dbbae",
"ext": ".jpg",
"mime": "image/jpeg",
"path": null,
"width": 601,
"height": 750,
"size": 117.55,
"url": "/uploads/medium_6_FDUBGB_f8b45dbbae.jpg"
},
"large": {
"name": "large_6FDUBGB.jpg",
"hash": "large_6_FDUBGB_f8b45dbbae",
"ext": ".jpg",
"mime": "image/jpeg",
"path": null,
"width": 801,
"height": 1000,
"size": 182.81,
"url": "/uploads/large_6_FDUBGB_f8b45dbbae.jpg"
}
},
"hash": "6_FDUBGB_f8b45dbbae",
"ext": ".jpg",
"mime": "image/jpeg",
"size": 597.08,
"url": "/uploads/6_FDUBGB_f8b45dbbae.jpg",
"previewUrl": null,
"provider": "local",
"provider_metadata": null,
"createdAt": "2023-02-07T11:39:40.120Z",
"updatedAt": "2023-02-07T11:39:40.120Z"
}
}
}
}
},
{
"id": 2,
"attributes": {
"createdAt": "2023-02-03T15:42:51.349Z",
"updatedAt": "2023-02-07T11:40:12.979Z",
"publishedAt": "2023-02-03T15:42:52.112Z",
"title": "Star Wars",
"year": 1977,
"description": "Luke Skywalker joins forces with a Jedi Knight, a cocky pilot, a Wookiee and two droide to save the galaxy from the Empire's wold-destroying battle station, while also attemting te rescue Princess Leia from the mysterious Darth Vader.",
"slug": "star-wars",
"image": {
"data": {
"id": 4,
"attributes": {
"name": "2008 Jaden.jpg",
"alternativeText": null,
"caption": null,
"width": 1868,
"height": 1304,
"formats": {
"thumbnail": {
"name": "thumbnail_2008 Jaden.jpg",
"hash": "thumbnail_2008_Jaden_3c49c0fe45",
"ext": ".jpg",
"mime": "image/jpeg",
"path": null,
"width": 223,
"height": 156,
"size": 9.92,
"url": "/uploads/thumbnail_2008_Jaden_3c49c0fe45.jpg"
},
"small": {
"name": "small_2008 Jaden.jpg",
"hash": "small_2008_Jaden_3c49c0fe45",
"ext": ".jpg",
"mime": "image/jpeg",
"path": null,
"width": 500,
"height": 349,
"size": 35.21,
"url": "/uploads/small_2008_Jaden_3c49c0fe45.jpg"
},
"medium": {
"name": "medium_2008 Jaden.jpg",
"hash": "medium_2008_Jaden_3c49c0fe45",
"ext": ".jpg",
"mime": "image/jpeg",
"path": null,
"width": 750,
"height": 524,
"size": 65.83,
"url": "/uploads/medium_2008_Jaden_3c49c0fe45.jpg"
},
"large": {
"name": "large_2008 Jaden.jpg",
"hash": "large_2008_Jaden_3c49c0fe45",
"ext": ".jpg",
"mime": "image/jpeg",
"path": null,
"width": 1000,
"height": 698,
"size": 102.08,
"url": "/uploads/large_2008_Jaden_3c49c0fe45.jpg"
}
},
"hash": "2008_Jaden_3c49c0fe45",
"ext": ".jpg",
"mime": "image/jpeg",
"size": 258.7,
"url": "/uploads/2008_Jaden_3c49c0fe45.jpg",
"previewUrl": null,
"provider": "local",
"provider_metadata": null,
"createdAt": "2023-02-07T11:40:06.583Z",
"updatedAt": "2023-02-07T11:40:06.583Z"
}
}
}
}
}
],
"meta": {
"pagination": {
"page": 1,
"pageSize": 25,
"pageCount": 1,
"total": 2
}
}
}

Strapi 4.6 back-end with Nextjs 13 as front-end

How can I get the image stored in Strapi 4.6 displayed on the screen with nextjs 13:
export default function Page({ params }) {
let movie = use(getMovie(params.movieID));
console.log("Movie This is the text", movie);
//console.log(params.movieID);
//console.log("Database output !!!", movie.${params.movieID}.?populate=*);
//const API_URL = ('http://127.0.0.1:1337');
return (
<div>
<p className="text-3xl">{movie.data.attributes.title}</p>
<p className="mt-2">Year: {movie.data.attributes.year}</p>
<p className="mt-2">Description: {movie.data.attributes.description}</p>
<Image className='mt-2'
src={movie.data.attributes.image.data.attributes.url}
alt={movie.data.attributes.title}
width={500}
height={349}
/>
</div>
);
}
The Title, year, and description of the movie are fixable on the screen.
On de server side I am receiving the following error:
event - compiled client and server successfully in 145 ms (545 modules)
The requested resource isn't a valid image for /uploads/2008_Jaden_3c49c0fe45.jpg received text/html; charset=utf-8
The settings of my next.config.js file are:
/** #type {import('next').NextConfig} */
const nextConfig = {
experimental: {
appDir: true,
},
images: {
remotePatterns: [
{
protocol: "http",
hostname: "127.0.0.1",
port: "1337",
pathname: "/**",
},
],
},
};
module.exports = nextConfig;
Strapi 4.6 return the following API:
// 20230217152302
// http://127.0.0.1:1337/api/movies?populate=*
{
"data": [
{
"id": 1,
"attributes": {
"createdAt": "2023-02-03T15:39:55.796Z",
"updatedAt": "2023-02-07T11:39:47.652Z",
"publishedAt": "2023-02-03T15:40:08.569Z",
"title": "Lord of the Rings",
"year": 2001,
"description": "A meek Hobbit from the Shire and eight companions set out on a journey to destroy the powerful One Ring and save Middle-earth from the Dark Lord Sauron",
"slug": "lord-of-the-rings",
"image": {
"data": {
"id": 3,
"attributes": {
"name": "6FDUBGB.jpg",
"alternativeText": null,
"caption": null,
"width": 2000,
"height": 2496,
"formats": {
"thumbnail": {
"name": "thumbnail_6FDUBGB.jpg",
"hash": "thumbnail_6_FDUBGB_f8b45dbbae",
"ext": ".jpg",
"mime": "image/jpeg",
"path": null,
"width": 125,
"height": 156,
"size": 8.49,
"url": "/uploads/thumbnail_6_FDUBGB_f8b45dbbae.jpg"
},
"small": {
"name": "small_6FDUBGB.jpg",
"hash": "small_6_FDUBGB_f8b45dbbae",
"ext": ".jpg",
"mime": "image/jpeg",
"path": null,
"width": 401,
"height": 500,
"size": 62.75,
"url": "/uploads/small_6_FDUBGB_f8b45dbbae.jpg"
},
"medium": {
"name": "medium_6FDUBGB.jpg",
"hash": "medium_6_FDUBGB_f8b45dbbae",
"ext": ".jpg",
"mime": "image/jpeg",
"path": null,
"width": 601,
"height": 750,
"size": 117.55,
"url": "/uploads/medium_6_FDUBGB_f8b45dbbae.jpg"
},
"large": {
"name": "large_6FDUBGB.jpg",
"hash": "large_6_FDUBGB_f8b45dbbae",
"ext": ".jpg",
"mime": "image/jpeg",
"path": null,
"width": 801,
"height": 1000,
"size": 182.81,
"url": "/uploads/large_6_FDUBGB_f8b45dbbae.jpg"
}
},
"hash": "6_FDUBGB_f8b45dbbae",
"ext": ".jpg",
"mime": "image/jpeg",
"size": 597.08,
"url": "/uploads/6_FDUBGB_f8b45dbbae.jpg",
"previewUrl": null,
"provider": "local",
"provider_metadata": null,
"createdAt": "2023-02-07T11:39:40.120Z",
"updatedAt": "2023-02-07T11:39:40.120Z"
}
}
}
}
},
{
"id": 2,
"attributes": {
"createdAt": "2023-02-03T15:42:51.349Z",
"updatedAt": "2023-02-07T11:40:12.979Z",
"publishedAt": "2023-02-03T15:42:52.112Z",
"title": "Star Wars",
"year": 1977,
"description": "Luke Skywalker joins forces with a Jedi Knight, a cocky pilot, a Wookiee and two droide to save the galaxy from the Empire's wold-destroying battle station, while also attemting te rescue Princess Leia from the mysterious Darth Vader.",
"slug": "star-wars",
"image": {
"data": {
"id": 4,
"attributes": {
"name": "2008 Jaden.jpg",
"alternativeText": null,
"caption": null,
"width": 1868,
"height": 1304,
"formats": {
"thumbnail": {
"name": "thumbnail_2008 Jaden.jpg",
"hash": "thumbnail_2008_Jaden_3c49c0fe45",
"ext": ".jpg",
"mime": "image/jpeg",
"path": null,
"width": 223,
"height": 156,
"size": 9.92,
"url": "/uploads/thumbnail_2008_Jaden_3c49c0fe45.jpg"
},
"small": {
"name": "small_2008 Jaden.jpg",
"hash": "small_2008_Jaden_3c49c0fe45",
"ext": ".jpg",
"mime": "image/jpeg",
"path": null,
"width": 500,
"height": 349,
"size": 35.21,
"url": "/uploads/small_2008_Jaden_3c49c0fe45.jpg"
},
"medium": {
"name": "medium_2008 Jaden.jpg",
"hash": "medium_2008_Jaden_3c49c0fe45",
"ext": ".jpg",
"mime": "image/jpeg",
"path": null,
"width": 750,
"height": 524,
"size": 65.83,
"url": "/uploads/medium_2008_Jaden_3c49c0fe45.jpg"
},
"large": {
"name": "large_2008 Jaden.jpg",
"hash": "large_2008_Jaden_3c49c0fe45",
"ext": ".jpg",
"mime": "image/jpeg",
"path": null,
"width": 1000,
"height": 698,
"size": 102.08,
"url": "/uploads/large_2008_Jaden_3c49c0fe45.jpg"
}
},
"hash": "2008_Jaden_3c49c0fe45",
"ext": ".jpg",
"mime": "image/jpeg",
"size": 258.7,
"url": "/uploads/2008_Jaden_3c49c0fe45.jpg",
"previewUrl": null,
"provider": "local",
"provider_metadata": null,
"createdAt": "2023-02-07T11:40:06.583Z",
"updatedAt": "2023-02-07T11:40:06.583Z"
}
}
}
}
}
],
"meta": {
"pagination": {
"page": 1,
"pageSize": 25,
"pageCount": 1,
"total": 2
}
}
}
Hopefully someone can help me out?
Thanks on forehand for your help!
Robert
Strapi only returns the relative paths of your images (or media in general). You need to prepend those paths with the URL/domain on which your Strapi is hosted.
E.g:
"http://127.0.0.1:1337" + "/uploads/2008_Jaden_3c49c0fe45.jpg"
"https://my-hosted-strapi.com" + "/uploads/2008_Jaden_3c49c0fe45.jpg"

Why is watcher giving errors?

I want to send slack notifications to a channel as soon as any log with loglevel ERROR appears in my index. I have configured watcher in the following way but it is giving me errors. The slack message must have the log message.
I am not able to configure this exactly.
{
"trigger": {
"schedule": {
"interval": "10s"
}
},
"input": {
"search": {
"request": {
"search_type": "query_then_fetch",
"indices": [
"index-log*",
"index-beat*"
],
"rest_total_hits_as_int": true,
"body": {
"query": {
"match": {
"loglevel": "ERROR"
},
"range": {
"#timestamp": {
"from": "{{ctx.trigger.scheduled_time}}||-5m",
"to": "{{ctx.trigger.triggered_time}}"
}
}
}
}
}
}
},
"condition": {
"compare": {
"ctx.payload.hits.total": {
"gt": 0
}
}
},
"actions": {
"send_trigger": {
"webhook": {
"scheme": "https",
"host": "hooks.slack.com",
"port": 443,
"method": "post",
"path": "/services/XXXX/XXXX/XXXX",
"params": {},
"headers": {
"Content-type": "application/json"
},
"body": """{ "text": "{{ctx.payload}}"}"""
}
}
}
}
below is the structure of my logs in kibana
{
"_index": "index-beat",
"_type": "_doc",
"_id": "P3Toa34B1LVeuWotaVOY",
"_version": 1,
"_score": 1,
"_source": {
"#timestamp": "2022-01-18T06:38:19.559Z",
"name": "communication",
"loglevel": "ERROR",
"log": {
"file": {
"path": "/home/ubuntu/abc/abc/logs/communication.log"
},
"offset": 0
},
"timestamp": "2022-01-18T06:38:15.384279",
"exception": {
"ex_type": "None",
"ex": "None",
"tb": ""
},
"message": "{'err': 'Test'}"
},
"fields": {
"exception.ex_type": [
"None"
],
"loglevel.keyword": [
"ERROR"
],
"name.keyword": [
"communication"
],
"log.offset": [
0
],
"message": [
"{'err': 'Test'}"
],
"exception.tb": [
""
],
"exception.ex": [
"None"
],
"#timestamp": [
"2022-01-18T06:38:19.559Z"
],
"exception.tb.keyword": [
""
],
"loglevel": [
"ERROR"
],
"log.file.path": [
"/home/ubuntu/abc/abc/logs/communication.log"
],
"message.keyword": [
"{'err': 'Test'}"
],
"name": [
"communication"
],
"exception.ex_type.keyword": [
"None"
],
"exception.ex.keyword": [
"None"
],
"log.file.path.keyword": [
"/home/ubuntu/abc/abc/logs/communication.log"
],
"timestamp": [
"2022-01-18T06:38:15.384Z"
]
}
}
Please help me out in this one.

How to host Alexa Skill using Express API (Web Server)

I've been stuck with hosting an alexa skill webserver on my localhost!
Everything's correct from the Intents I've made, the url works, and it does request the intent I ask it for, but Alexa constantly keeps saying "There was a problem with the requested skill's response"
const express = require("express");
const Alexa = require('ask-sdk-core');
const { ExpressAdapter } = require("ask-sdk-express-adapter");
const app = express();
const LaunchRequestHandler = {
canHandle(handlerInput) {
return handlerInput.requestEnvelope.request.type === 'LaunchRequest';
},
handle(handlerInput) {
const speechText = 'Hello World - Your skill has launched';
return handlerInput.responseBuilder
.speak(speechText)
.reprompt(speechText)
.withSimpleCard('Hello World', speechText)
.getResponse();
}
};
const builder = Alexa.SkillBuilders.custom();
builder.addRequestHandlers(
LaunchRequestHandler
);
const skill = builder.create();
const adapter = new ExpressAdapter(skill, false, false);
app.post('/', adapter.getRequestHandlers());
app.listen(443, null, () => {
console.log("App is now online!");
});
This is the json body it gives when it tries to send a post / first
{
"version": "1.0",
"session": {
"new": false,
"sessionId": "amzn1.echo-api.session.325e7e93-3033-4e26-ada6-45f7967971bf",
"application": {
"applicationId": "amzn1.ask.skill.c1ed78ba-9003-4904-9376-b9a05b3a4bcc"
},
"attributes": {},
"user": {
"userId": "amzn1.ask.account.AH7FLOU7DBFRWVIENTV7VT7EMQLPAGYMFU4YUTI6OSBCK6GOKXWNQ6BI3BPZPEMN2TQFXGZCO43KXB3HJNVJPBJILPEDLGIAMQK2DK3C42S5FBPCQSN6B46FMQDATFSCL42YCF25PR5CFPGHYUFIDIJHZAJRIGMZ5BGZMU7FNJB4I6KBVDF5N2WIXCIG6YMV2X4ZO3QETGA23HQ"
}
},
"context": {
"Viewports": [
{
"type": "APL",
"id": "main",
"shape": "RECTANGLE",
"dpi": 213,
"presentationType": "STANDARD",
"canRotate": false,
"configuration": {
"current": {
"mode": "HUB",
"video": {
"codecs": [
"H_264_42",
"H_264_41"
]
},
"size": {
"type": "DISCRETE",
"pixelWidth": 1280,
"pixelHeight": 800
}
}
}
}
],
"Viewport": {
"experiences": [
{
"arcMinuteWidth": 346,
"arcMinuteHeight": 216,
"canRotate": false,
"canResize": false
}
],
"mode": "HUB",
"shape": "RECTANGLE",
"pixelWidth": 1280,
"pixelHeight": 800,
"dpi": 213,
"currentPixelWidth": 1280,
"currentPixelHeight": 800,
"touch": [
"SINGLE"
],
"video": {
"codecs": [
"H_264_42",
"H_264_41"
]
}
},
"Extensions": {
"available": {
"aplext:backstack:10": {}
}
},
"System": {
"application": {
"applicationId": "amzn1.ask.skill.c1ed78ba-9003-4904-9376-b9a05b3a4bcc"
},
"user": {
"userId": "amzn1.ask.account.AH7FLOU7DBFRWVIENTV7VT7EMQLPAGYMFU4YUTI6OSBCK6GOKXWNQ6BI3BPZPEMN2TQFXGZCO43KXB3HJNVJPBJILPEDLGIAMQK2DK3C42S5FBPCQSN6B46FMQDATFSCL42YCF25PR5CFPGHYUFIDIJHZAJRIGMZ5BGZMU7FNJB4I6KBVDF5N2WIXCIG6YMV2X4ZO3QETGA23HQ"
},
"device": {
"deviceId": "amzn1.ask.device.AGZ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": "SessionEndedRequest",
"requestId": "amzn1.echo-api.request.e6d2bca6-4680-4367-8bb1-104e038c35ba",
"timestamp": "2021-12-03T02:22:58Z",
"locale": "en-US",
"reason": "ERROR",
"error": {
"type": "INVALID_RESPONSE",
"message": "An exception occurred while dispatching the request to the skill."
}
}
}
And the 2nd json body post / request when it errors:
{
"version": "1.0",
"session": {
"new": false,
"sessionId": "amzn1.echo-api.session.325e7e93-3033-4e26-ada6-45f7967971bf",
"application": {
"applicationId": "amzn1.ask.skill.c1ed78ba-9003-4904-9376-b9a05b3a4bcc"
},
"attributes": {},
"user": {
"userId": "amzn1.ask.account.AH7FLOU7DBFRWVIENTV7VT7EMQLPAGYMFU4YUTI6OSBCK6GOKXWNQ6BI3BPZPEMN2TQFXGZCO43KXB3HJNVJPBJILPEDLGIAMQK2DK3C42S5FBPCQSN6B46FMQDATFSCL42YCF25PR5CFPGHYUFIDIJHZAJRIGMZ5BGZMU7FNJB4I6KBVDF5N2WIXCIG6YMV2X4ZO3QETGA23HQ"
}
},
"context": {
"Viewports": [
{
"type": "APL",
"id": "main",
"shape": "RECTANGLE",
"dpi": 213,
"presentationType": "STANDARD",
"canRotate": false,
"configuration": {
"current": {
"mode": "HUB",
"video": {
"codecs": [
"H_264_42",
"H_264_41"
]
},
"size": {
"type": "DISCRETE",
"pixelWidth": 1280,
"pixelHeight": 800
}
}
}
}
],
"Viewport": {
"experiences": [
{
"arcMinuteWidth": 346,
"arcMinuteHeight": 216,
"canRotate": false,
"canResize": false
}
],
"mode": "HUB",
"shape": "RECTANGLE",
"pixelWidth": 1280,
"pixelHeight": 800,
"dpi": 213,
"currentPixelWidth": 1280,
"currentPixelHeight": 800,
"touch": [
"SINGLE"
],
"video": {
"codecs": [
"H_264_42",
"H_264_41"
]
}
},
"Extensions": {
"available": {
"aplext:backstack:10": {}
}
},
"System": {
"application": {
"applicationId": "amzn1.ask.skill.c1ed78ba-9003-4904-9376-b9a05b3a4bcc"
},
"user": {
"userId": "amzn1.ask.account.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nGtjjDDCAAUyvB8ZIInbuxsrZ6DwYtuj5sa5_wGSfc0s2THQqP9Azklgk5UobwMN0iWsrhDSXy4guB4KaEJscD8_OLr2ZnbvWqy3tAPv3zfEsb8OmnOC7FBMHHgN-aCIRubnZNu8YA2Xtf-usOn1wVAjaIwEdlfgrOCRfFpZc3l7tfHTfX9HfLerRFh_IWQWc61DVfQZhyH4yeH5fdKUVDMels4zXlKQ"
}
},
"request": {
"type": "SessionEndedRequest",
"requestId": "amzn1.echo-api.request.e6d2bca6-4680-4367-8bb1-104e038c35ba",
"timestamp": "2021-12-03T02:22:58Z",
"locale": "en-US",
"reason": "ERROR",
"error": {
"type": "INVALID_RESPONSE",
"message": "An exception occurred while dispatching the request to the skill."
}
}
}
Here is my current code, hopefully someone can help me
After hours of researching and github searches, this is the github repo you need to look at if you are willing to host your skill locally using REST API
https://github.com/hanstxu/alexa_endpoint_js

Open graph fitness.runs returning no data

I have a bunch of Nike+ run data which i'm assuming (based on the below article) is published to the open graph. It certainly looks that way in my timeline.
https://developers.facebook.com/blog/post/2012/08/29/early-success-stories--fitness-and-open-graph/
Frustratingly while my music.listens request works fine and returns all of my Spotify listens, my request for fitness.runs returns no data. Is this simply because Nike haven't integrated correctly with the Open Graph. Or perhaps I need to request extended permissions in my Auth token?
https://developers.facebook.com/docs/reference/opengraph/action-type/fitness.runs
Any ideas?
As with all actions you need the correct permissions, in this case
user_actions.fitness
So the data returned from /me/fitness.runs for Nike will look like
{
"data": [
{
"id": "10101118696330517",
"from": {
"name": "Philippe Harewood",
"id": "13608786"
},
"start_time": "2013-03-22T23:15:56+0000",
"end_time": "2013-03-22T23:26:36+0000",
"publish_time": "2013-03-24T15:50:00+0000",
"application": {
"name": "Nike",
"namespace": "nikeapp",
"id": "84697719333"
},
"data": {
"course": {
"id": "476811255725972",
"url": "http://nikeplus.nike.com/plus/activity/running/detail/2118587303?external_share_id=CE32E1C4-93D8-48A7-A08F-6D5B4C13EE6A&is_new_meta=true",
"type": "fitness.course",
"title": "1.12 miles"
}
},
"type": "fitness.runs",
"no_feed_story": false,
"likes": {
"count": 0,
"can_like": true,
"user_likes": false
},
"comments": {
"count": 0,
"can_comment": true,
"comment_order": "chronological"
}
},
{
"id": "10101118696155867",
"from": {
"name": "Philippe Harewood",
"id": "13608786"
},
"start_time": "2013-03-19T22:03:32+0000",
"end_time": "2013-03-19T22:18:37+0000",
"publish_time": "2013-03-24T15:49:46+0000",
"application": {
"name": "Nike",
"namespace": "nikeapp",
"id": "84697719333"
},
"data": {
"course": {
"id": "502469216483599",
"url": "http://nikeplus.nike.com/plus/activity/running/detail/2118587302?external_share_id=EBF6BC1D-BDEA-4EE5-B18D-FBC576610F13&is_new_meta=true",
"type": "fitness.course",
"title": "1.49 miles"
}
},
"type": "fitness.runs",
"no_feed_story": false,
"likes": {
"count": 0,
"can_like": true,
"user_likes": false
},
"comments": {
"count": 0,
"can_comment": true,
"comment_order": "chronological"
}
}
],
"paging": {
"next": "https://graph.facebook.com/13608786/fitness.runs?limit=25&offset=25&__after_id=10101118696155867"
}
}

Resources