does the API for Mark a subscriber feed message as seen work in v0.23.0
I get this error when I make a request, {"error": "Not Found", "message": "Cannot POST /v1/subscribers/d42un09etvpar5r/messages/mark-as", "statusCode": 404}
17 Replies
@Bruno
checkout the swagger
<your-selfh-hosted-api-base-url>/api
I have double-checked but still getting the same error
can you share your api base url?
@Pawan Jain It's for a deployed project with confidential information
Do you see this api in swagger?
yes
@Bruno, you just advanced to level 1!
const options = {
method: 'POST',
headers: {
Authorization: novuApi,
'Content-Type': 'application/json',
},
body: JSON.stringify({
messageId: id,
markAs: 'read',
}),
};
return await fetch(
https://${novuUrl}/v1/subscribers/${userId}/messages/mark-as
,
options
)
.then((response) => response.json())
.then((response) => console.log('res::', response))
.catch((error) => console.log('errorAPI::', error));
};@Bruno can you share /api-json raw data here ?
{"_bodyBlob": {"_data": {"collector": [Object], "blobId": "fdb72614-f68d-46da-a0e1-b3b76dd23348", "offset": 0, "size": 111}}, "_bodyInit": {"_data": {"collector": [Object], "blobId": "fdb72614-f68d-46da-a0e1-b3b76dd23348", "offset": 0, "size": 111}}, "bodyUsed": false, "headers": {"map": {"access-control-allow-credentials": "true", "access-control-allow-headers": "DNT,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Range,Authorization", "access-control-allow-methods": "GET, PUT, POST, DELETE, PATCH, OPTIONS", "access-control-allow-origin": "*", "access-control-max-age": "1728000", "content-length": "111", "content-security-policy": "default-src 'self';base-uri 'self';font-src 'self' https: data:;form-action 'self';frame-ancestors 'self';img-src 'self' data:;object-src 'none';script-src 'self';script-src-attr 'none';style-src 'self' https: 'unsafe-inline';upgrade-insecure-requests", "content-type": "application/json; charset=utf-8", "cross-origin-embedder-policy": "require-corp", "cross-origin-opener-policy": "same-origin", "cross-origin-resource-policy": "same-origin", "date": "Tue, 24 Sep 2024 15:43:26 GMT", "etag": "W/"6f-fDcu6WcwYW216llmvVANfZ37kLw"", "origin-agent-cluster": "?1", "referrer-policy": "no-referrer", "strict-transport-security": "max-age=15724800; includeSubDomains", "vary": "Origin, Accept-Encoding", "x-content-type-options": "nosniff", "x-dns-prefetch-control": "off", "x-download-options": "noopen", "x-frame-options": "SAMEORIGIN", "x-permitted-cross-domain-policies": "none", "x-xss-protection": "0"}}, "ok": false, "status": 404, "statusText": "", "type": "default", "url": "https://my-base-url-was-here/v1/subscribers/d42un09etvpar5r/messages/mark-as"}
Unfortunately, it is not helpful, as most of the data is not there
Can you paste the whole content in a file and then send file here?
@Pawan Jain this is actually the whole response that I get
@Bruno
@Bruno
Can you please share the whole .json like this ?
@Bruno
As per this swagger, you should use this
/v1/subscribers/d42un09etvpar5r/messages/markAs
@Pawan Jain again thanks so much