I just need the link to use the MessagingService API, please anyone. Need it to integrate with my JavaScript code.
Bump
||tiosdgsdgserereeererdgds||
this?
Instead of waiting like 16 hours you couldve just dont a simple search and it probably wouldve most likely been the top result MessagingService | Roblox Creator Documentation
I honestly don’t understand either. Why would you make this post?
I need the link for the API itself to interact with my JavaScript code. Not the docs.
You could’ve been a bit more clearer then
My apologies. Will edit post now.
You won’t be able to use MessagingService for that, you would need to use HTTPService if you want to communicate data from an external source.
Yes, but I need messaging service for my integration to send stuff to ROBLOX. Right now I’ve integrated a ban system using my external DB with HTTPService, but I need to use MessagingService for another piece.
MessagingService is just for sending information between servers within a game. An external database would still need to use HTTPService.
I don’t think you’re getting where I’m coming from. I’m sending a request to messaging service API to interact with servers in the game, using an external integration. ROBLOX has an API for this, and I need to link to use it.
Found a link from LifeDigger’s Community Resource tutorial, not sure if its what you want or will help but its worth a try sending it anyway
It’s using MessagingService but from a 3rd party basically.
My Integration -> Requests MessagingService Request -> Roblox sees it and publishes to all servers
Thanks! Should work out for me!
no worries, did you figure it out after?
No. This is my code:
let res = await fetch("https://apis.roblox.com/messaging-service/v1/universes/4313843182/topics/Kick", {
method : "Post",
headers : {
["x-api-key"] : "NOT_MY_API_KEY",
},
body : { message : userid + ":::" + reason }
})
Says unsupported media type.
You need to specify the Content-Type header as application/json.
headers: {
["Content-Type"]: "application/json",
["x-api-key"]: "NOT_MY_API_KEY",
},
Content-Type (also called media type) tells the server what type of content you’re sending, I believe it defaults to plain text which is unsupported.
If you need more information on how to send using this API, this part of the documentation explains more about how to message live servers.
Part of the issue is what @Shirovian said (it should fix the media issue), unlike some packages likes axios (which should work fine without the content type) it seems like fetch does not automatically set the correct content type or something like that.
The other problem will occur when you try send the request with the content type set where it will say the request was a “Bad Request”. This seems to be caused in the body and should be fixed by just doing something like below. For some reason fetch also does not automatically send it correctly when you set the request like you have so rather then what you have done, you need to turn it to a string with JSON.stringify()
.