Sha256: 1b057fa191a84bc177cafc87b74b94b8c0792adba0642960ad7e7f2a99fa2d1f

Contents?: true

Size: 1.77 KB

Versions: 6

Compression:

Stored size: 1.77 KB

Contents

# #accounts

Querying the `account` API will return the metadata for the account.

{% hint style="info" %}
This account is the one that is associated with the authentication token.
{% endhint %}

### Basic usage

{% code lineNumbers="true" %}
```ruby
client = Monday::Client.new(token: <AUTH_TOKEN>)

response = client.account
# => <Monday::Response ...>

puts response.body
```
{% endcode %}

This will return the accounts' ID and name fields by default.

The response body from the above query would be as follows:

{% code lineNumbers="true" %}
```json
{
  "data": {
    "users": [
      {
        "account": {
          "id": 1234,
          "name": "Test User's Team"
        }
      }
    ]
  },
  "account_id": 123
}
```
{% endcode %}

### Customizing fields to retrieve

You can customize the fields to retrieve by passing in the `select` option and listing all the fields you need to retrieve as an array.

{% code lineNumbers="true" %}
```ruby
client = Monday::Client.new(token: <AUTH_TOKEN>)

select = %w[id name slug logo country_code]

response = client.account(select: select)

puts response.body
```
{% endcode %}

### Retrieving nested fields

Some fields have nested attributes, and you need to specify the attributes to retrieve that field; else, the API will respond with an error. For example, the field `plan` is of type `Plan` and expects you to pass the attributes you want to retrieve for the `plan` field.

{% code lineNumbers="true" %}
```ruby
client = Monday::Client.new(token: <AUTH_TOKEN>)

select = [
  "id",
  "name",
  {
    creator: %w[id name email is_admin]
  }
]

response = client.boards(select: select)

puts response.body
```
{% endcode %}

You can find the list of all the available fields for account [here](https://developer.monday.com/api-reference/docs/account#fields).

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
monday_ruby-0.6.2 docs/resources/account/accounts.md
monday_ruby-0.6.1 docs/resources/account/accounts.md
monday_ruby-0.6.0 docs/resources/account/accounts.md
monday_ruby-0.4.0 docs/resources/account/accounts.md
monday_ruby-0.3.0 docs/resources/account/accounts.md
monday_ruby-0.2.0 docs/resources/account/accounts.md