# getShout

#### api.getShout

`api.getShout()`: table

Returns a table including status and shout data.

#### Return table

```lua
{
  status = boolean,
  code = number,
  error = string,
  data = {
    body = string,
    poster = {
      userId = number,
      username = string,
      displayName = string
    },
    updated = string
  }
}
```

| Table                   | Type    | Description                                                            |
| ----------------------- | ------- | ---------------------------------------------------------------------- |
| status                  | boolean | True if request went though, False if request didn't go through        |
| code                    | number  | The status code of the request                                         |
| error                   | string  | This tells you what went wrong. Only will be given if status is false. |
| data.body               | string  | The shout message                                                      |
| data.poster.userId      | number  | The shouters userid                                                    |
| data.poster.username    | string  | The shouters username                                                  |
| data.poster.displayName | string  | The shouters display name                                              |
| data.updated            | string  | Date and Time when the shout was updated                               |

#### Possible Errors

```lua
{
  status = false,
  code = 429,
  error = "Too Many Requests"
}
{
  status = false,
  code = 400,
  error = "The bot does not have permissions to view the shout for the group"
}
{
  status = false,
  code = 0,
  error = "Error not found"
}
```

#### Example

```lua
local API = require(10005387312)({key = "Key Here", beta = false}) 

game.Players.PlayerAdded:connect(function(player)
	player.CharacterAdded:Connect(function()
		if player.UserId == 123445 then
			local success, shout = pcall(function()
				return API.getShout()
			end)
			if not success then return error(shout) end
			if shout.status then
				print('The group shout is ' .. shout.data.body)
			else
				error('EasyRanks '.. tostring(shout.code) .. ': ' .. shout.error)
			end
		end	
	end)
end)
```

This example grabs the group shout when someone with the userid 123445 joins your game. This shows you how to grab the current group shout when someone joins your game, hopefully you can take this and make more out of it.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.easyranks.tech/reference/api-reference/getshout.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
