N
Novu2mo ago
Bruno

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
Pawan Jain
Pawan Jain2mo ago
@Bruno checkout the swagger <your-selfh-hosted-api-base-url>/api
Bruno
BrunoOP2mo ago
I have double-checked but still getting the same error
Pawan Jain
Pawan Jain2mo ago
can you share your api base url?
Bruno
BrunoOP2mo ago
@Pawan Jain It's for a deployed project with confidential information
Pawan Jain
Pawan Jain2mo ago
Do you see this api in swagger?
Bruno
BrunoOP2mo ago
yes
Novu_Bot
Novu_Bot2mo ago
@Bruno, you just advanced to level 1!
Bruno
BrunoOP2mo ago
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)); };
Pawan Jain
Pawan Jain2mo ago
@Bruno can you share /api-json raw data here ?
Bruno
BrunoOP2mo ago
{"_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"}
Pawan Jain
Pawan Jain2mo ago
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?
Bruno
BrunoOP2mo ago
@Pawan Jain this is actually the whole response that I get
Pawan Jain
Pawan Jain2mo ago
Pawan Jain
Pawan Jain2mo ago
@Bruno Can you please share the whole .json like this ?
Bruno
BrunoOP2mo ago
@Pawan Jain Thanks for the clarification here is the file
Pawan Jain
Pawan Jain2mo ago
@Bruno As per this swagger, you should use this /v1/subscribers/d42un09etvpar5r/messages/markAs
Bruno
BrunoOP2mo ago
@Pawan Jain again thanks so much
Want results from more Discord servers?
Add your server