Post Notification with request module

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: <>.
          @prefix as: <> .
          @prefix schema: <> .
          @prefix solid: <> .
          @prefix xsd: <> .
          @prefix rdf: <> .
          @prefix : <${webId + `viade/inbox/` + uuid + `.ttl`}>.
          <${webId + `viade/inbox/` + uuid + `.ttl`}> a as:${type} ;
          schema:license <>;
          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

1 Like

You can suggest a name for a file by adding a slug to the POST. However Solid can change that name when it stores the file. In order to know the name it stores the file under, you need to read the location header of the response from the POST. In some circumstances you create resources with PUT, those always have the exact name you gave it.

1 Like

Here’s an example of using a slug:

solid.auth.fetch(  PARENT_CONTAINER_URI, {
    slug: FILENAME
    link: '<>; rel="type"',
    "content-type": FILETYPE

I used the slug approach and it works fine:

Thank you so much!!