Using a get/post request for receiving messages would require polling, and that creates unnecessary traffic. Websockets or some other way for roblox to send messages instead of us polling for messages would be ideal. There is a reason services like discord use websockets to push events.
Any ETA on when this will be made available for models and packages?
Presently we have to use a bot account cookie to manage our rojo package uploads.
Unfortunately we don’t have ETAs but we have been thinking about these specific entities to add to our suite of APIs. As we formulate more concrete plans, we’ll definitely let the community know.
This is incredible, it’s another API that I can take advantage of for an upcoming project. I wonder when group management will be next, as with that, I won’t need cookie authentication anymore
I’m a bit unfamiliar with messaging service. Should I expect this to work for a place running inside Studio, or only on real game servers?
For now, it only sends to live game servers. Messaging to Studio will be supported later.
I keep on getting “Request body not in correct format.” 400
what am i doing wrong??
header = {
'x-api-key':apikey,
'Content-Type':'application/json'}
url = 'https://apis.roblox.com/messaging-service/v1/universes/{}/topics/{}'.format(universeid,topic)
tosend = {
"message":'hi'
}
response = requests.post(url,data=tosend,headers=header)
print('>>sent! ', response.text,response.status_code)
Is there any way to run sent messages through the chat filter?
I would try json=tosend
instead of data=tosend
I am still very much looking forward to trying Open Cloud one day. All this functionality sounds great.
Our game (aka universe) doesn’t appear in search when trying to set Place Permissions for an API key. This affects any API System including DataStore, Messaging Service and Place Publishing.
Does anyone know why?
We have other games (like Dev/Beta environments) that will show up in search. It’s only our main public game that doesn’t appear.
You may think it’s to do with the use of Emoji, but I have even tried removing the emoji to no avail.
Like a few people upthread, I’m also only getting 400 Bad Request when trying to set the message
field to a json object. It works as expected when message
is a string, number, or bool.
It isn’t clear if this is intended but it isn’t mentioned in the documentation.
Example curl commands:
curl -v \
--location --request POST 'https://apis.roblox.com/messaging-service/v1/universes/3729025203/topics/{topic}' \
--header 'x-api-key: hunter2' \
--header 'Content-Type: application/json' \
--data-raw '{"message":"This gets a 200"}'
curl -v \
--location --request POST 'https://apis.roblox.com/messaging-service/v1/universes/3729025203/topics/{topic}' \
--header 'x-api-key: hunter2' \
--header 'Content-Type: application/json' \
--data-raw '{"message":{"a":"This gets a 400"}}'
So I’m guessing that I would have to JSONDecode it then? Which means i’d have to add logic to the Subscribed message checking to see if the data is a string then decode it. :\
The actual message requires to be a JSON encoded string. In your case, it would look something like
--data-raw '{"message":"{\"a\":\"This gets a 400\"}}"}'
Ah, I didn’t realize it had to be string because it also accepts numbers and bools, but looking closer it seems like those get converted to strings before actually reaching the game server.
I would suggest putting that somewhere prominent in the documentation. I expected this to follow the ‘normal’ rules about what can be serialized for DataStores, RemoteEvents, etc and I’m surprised to see this has different restrictions.
If you are sending a simple string, you don’t need to have decode logic on the subscriber.
For example, if you are sending a simple string as:
--data-raw '{"message":"message to publish"}'
Subscriber will only receive "message to publish"
The body data must be stringified JSON
Is there any way to confirm if a server has received a request using this?
As far as I can see the best way would be for the game server to send a http request telling your external system the message was received if you need this confirmation.
You’re just gonna have to believe it.
This seems like a sponsored ad lol…