Hello, I’m trying to create a notification and send that notification to another user whithout using the solid hook. My problem is that the id of the notification seems to be created automatically, and so, it’s different from the one I’m passing as parameter in the createNotificationContent method (showed below).
This is what I’m currently getting:
or, if you’d like to see the source section:
My code for creating the notification and its content is the following:
export async function postNotification(webIdFriend, content, uuid) {
var inbox = webIdFriend + "/viade/inbox/";
await request({
method: "POST",
uri: inbox,
body: content,
headers: {
"Content-Type": "text/turtle"
}
},
function (error, response, content) {
if (error) {
return false;
} else {
return true;
}
})
}
export function createNotificationContent(type, title, webId, routePath, time, uuid) {
return `@prefix terms: <http://purl.org/dc/terms#>.
@prefix as: <https://www.w3.org/ns/activitystreams#> .
@prefix schema: <http://schema.org/> .
@prefix solid: <http://www.w3.org/ns/solid/terms#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix : <${webId + `viade/inbox/` + uuid + `.ttl`}>.
<${webId + `viade/inbox/` + uuid + `.ttl`}> a as:${type} ;
schema:license <https://creativecommons.org/licenses/by-sa/4.0/>;
terms:title "${title}" ;
as:summary "${routePath}" ;
as:actor <${webId}> ;
solid:read "false"^^xsd:boolean ;
as:published "${ time}"^^xsd:dateTime .`
}
I’m using the module request in order to do the post request.
How could I create that id myself?
Thanks in advance