NAV Navbar
cURL
  • Introduction
  • Authentication
  • Members
  • Tags
  • Events
  • Errors
  • Introduction

    Welcome to the Berrly API! You can use our API to access API endpoints, which can get information on members, events, and attendance in your organization.

    We have language bindings in Shell! You can view code examples in the dark area to the right, and you can switch the programming language of the examples with the tabs in the top right.

    Authentication

    To authorize, use this code:

    # With shell, you can just pass the correct header with each request
    curl "api_endpoint_here"
      -H "Authorization: Bearer your_token_here"
    

    Make sure to replace your_token_here with your API key.

    Berrly uses API keys to allow access to the API. You will need API module activated. If you can't see any API entrance in the main side bar you can write us an email at info@berrly.com.

    Berrly expects for the API key to be included in all API requests to the server in a header that looks like the following:

    Authorization: Bearer 1234567890

    Members

    Get All Members

    curl "https://api.berrly.com/v1/members"
      -H "Authorization: Bearer your_token_here"
    

    The above command returns JSON structured like this:

    [
      {
          "id_member": 1,
          "national_id_number": "XXXXXXXXD",
          "national_id_type": "dni",
          "name": "Johan",
          "last_name": "Cruyff",
          "alias": "El Flaco",
          "gender": 1,
          "birthdate": "1947-04-25",
          "email": "johan@example.com",
          "email2": null,
          "email3": null,
          "phone_mobile": "12345678",
          "phone_number": null,
          "phone_emergency": null,
          "address": "Street Lorem Ipsum, 23",
          "postal_code": "123456",
          "city": "Amsterdam",
          "province": "Barcelona",
          "country": "Netherlands",
          "comments": "Soccer is simple, but it is difficult to play simple.",
          "subscription_date": "1973-10-28",
          "photo": null,
          "xtags": [
              "football",
              "trainer",
              "happy"
          ],
          "created_at": "2017-03-12 19:52:59",
          "updated_at": "2017-09-12 11:49:12"
      }, 
      {
         "id_member": 2, ...
      },
      {
         "id_member": 3, ...
      }
    ]
    

    This endpoint retrieves all members.

    HTTP Request

    GET https://api.berrly.com/v1/members

    GET Parameters

    Parameter Description
    tag You can filter only members with this tag (optional)
    id_extra_field You can filter only members with this Extra Field (optional)
    value_extra_field If you want to filtre by Extra Field you must set a "value"

    Get a Specific Member

    curl "https://api.berrly.com/v1/members/{id_member}"
      -H "Authorization: Bearer your_token_here"
    

    The above command returns JSON structured like this:

    {
      "id_member": 1,
      "national_id_number": "XXXXXXXXD",
      "national_id_type": "dni",
      "name": "Johan",
      "last_name": "Cruyff",
      "alias": "El Flaco",
      "gender": 1,
      "birthdate": "1947-04-25",
      "email": "johan@example.com",
      "email2": null,
      "email3": null,
      "phone_mobile": "12345678",
      "phone_number": null,
      "phone_emergency": null,
      "address": "Street Lorem Ipsum, 23",
      "postal_code": "123456",
      "city": "Amsterdam",
      "province": "Barcelona",
      "country": "Netherlands",
      "comments": "Soccer is simple, but it is difficult to play simple.",
      "subscription_date": "1973-10-28",
      "photo": null,
      "xtags": [
          "football",
          "trainer",
          "happy"
      ],
      "created_at": "2017-03-12 19:52:59",
      "updated_at": "2017-09-12 11:49:12",
      "extra_fields": [
            {
                "id_field_schema": 0,
                "name": "Example number",
                "type": "NUMBER",
                "value": "31415"
            },
            {
                "id_field_schema": 1,
                "name": "Example date",
                "type": "DATE",
                "value": "24/06/1983"
            },
            {
                "id_field_schema": 2,
                "name": "Example text",
                "type": "VARCHAR",
                "value": null
            },
            ...
      ]
    }
    

    This endpoint retrieves a specific member.

    HTTP Request

    GET https://api.berrly.com/v1/members/{id_member}

    URL Parameters

    Parameter Description
    id_member The ID of the member to retrieve

    Create or Update a Member

    curl -X POST "https://api.berrly.com/v1/members/{id_member?}"
      -H "Authorization: Bearer your_token_here"
      -d "parameter=value"
    

    The above command returns JSON structured like this:

    {
      "id_member": 1,
      "national_id_number": "XXXXXXXXD",
      "national_id_type": "dni",
      "name": "Johan",
      "last_name": "Cruyff",
      "alias": "El Flaco",
      "gender": 1,
      "birthdate": "1947-04-25",
      "email": "johan@example.com",
      "email2": null,
      "email3": null,
      "phone_mobile": "12345678",
      "phone_number": null,
      "phone_emergency": null,
      "address": "Street Lorem Ipsum, 23",
      "postal_code": "123456",
      "city": "Amsterdam",
      "province": "Barcelona",
      "country": "Netherlands",
      "comments": "Soccer is simple, but it is difficult to play simple.",
      "subscription_date": "1973-10-28",
      "photo": null,
      "xtags": [],
      "created_at": "2017-03-12 19:52:59",
      "updated_at": "2017-03-12 19:52:59",
      "extra_fields": [
            {
                "id_field_schema": 0,
                "name": "Example number",
                "type": "NUMBER",
                "value": null
            },
            {
                "id_field_schema": 1,
                "name": "Example date",
                "type": "DATE",
                "value": null
            },
            {
                "id_field_schema": 2,
                "name": "Example text",
                "type": "VARCHAR",
                "value": null
            },
            ...
      ]
    }
    

    This endpoint retrieves a specific member.

    HTTP Request

    POST https://api.berrly.com/v1/members/{id_member?}

    URL Parameters

    Parameter Description
    id_member The ID of the member to set update (optional)

    POST Parameters

    Parameter Description
    national_id_type 'dni', 'nie', or 'passport'
    national_id_number ID number
    name Name
    last_name Last name
    alias Alias
    gender 0 or 1
    birthdate Birthdate YYYY-MM-DD
    email E-mail 1
    email2 E-mail 2
    email3 E-mail 3
    phone_mobile Mobile phone number
    phone_number Phone number
    phone_emergency Emergency Phone number
    address Address
    postal_code Postal Code
    city City
    province Province
    country Country
    comments Comments
    subscription_date Subscription date YYYY-MM-DD

    Set an Extra Field

    curl -X POST "https://api.berrly.com/v1/members/set-extra-field/{id_member}/{id_field_schema}"
      -H "Authorization: Bearer your_token_here"
      -d "parameter=value"
    

    The above command returns JSON structured like this:

    {
      "id_member": 1,
      "national_id_number": "XXXXXXXXD",
      "national_id_type": "dni",
      "name": "Johan",
      "last_name": "Cruyff",
      "alias": "El Flaco",
      "gender": 1,
      "birthdate": "1947-04-25",
      "email": "johan@example.com",
      "email2": null,
      "email3": null,
      "phone_mobile": "12345678",
      "phone_number": null,
      "phone_emergency": null,
      "address": "Street Lorem Ipsum, 23",
      "postal_code": "123456",
      "city": "Amsterdam",
      "province": "Barcelona",
      "country": "Netherlands",
      "comments": "Soccer is simple, but it is difficult to play simple.",
      "subscription_date": "1973-10-28",
      "photo": null,
      "xtags": [
          "football",
          "trainer",
          "happy"
      ],
      "created_at": "2017-03-12 19:52:59",
      "updated_at": "2017-09-12 11:49:12",
      "extra_fields": [
            {
                "id_field_schema": 0,
                "name": "Example number",
                "type": "NUMBER",
                "value": "31415"
            },
            {
                "id_field_schema": 1,
                "name": "Example date",
                "type": "DATE",
                "value": "24/06/1983"
            },
            {
                "id_field_schema": 2,
                "name": "Example text",
                "type": "VARCHAR",
                "value": null
            },
            ...
      ]
    }
    

    This endpoint retrieves a specific member.

    HTTP Request

    POST https://api.berrly.com/v1/members/set-extra-field/{id_member}/{id_field_schema}

    URL Parameters

    Parameter Description
    id_member The ID of the member to set attendance
    id_field_schema The ID of the Extra Field

    POST Parameters

    Parameter Options
    value Content for an extra field (null is ok)

    Set a Tag

    curl -X POST "https://api.berrly.com/v1/members/set-tag/{id_member}"
      -H "Authorization: Bearer your_token_here"
      -d "parameter=value"
    

    The above command returns JSON structured like this:

    {
      "id_member": 1,
      "national_id_number": "XXXXXXXXD",
      "national_id_type": "dni",
      "name": "Johan",
      "last_name": "Cruyff",
      "alias": "El Flaco",
      "gender": 1,
      "birthdate": "1947-04-25",
      "email": "johan@example.com",
      "email2": null,
      "email3": null,
      "phone_mobile": "12345678",
      "phone_number": null,
      "phone_emergency": null,
      "address": "Street Lorem Ipsum, 23",
      "postal_code": "123456",
      "city": "Amsterdam",
      "province": "Barcelona",
      "country": "Netherlands",
      "comments": "Soccer is simple, but it is difficult to play simple.",
      "subscription_date": "1973-10-28",
      "photo": null,
      "xtags": [
          "football",
          "trainer",
          "happy"
      ],
      "created_at": "2017-03-12 19:52:59",
      "updated_at": "2017-09-12 11:49:12",
      "extra_fields": [
            {
                "id_field_schema": 0,
                "name": "Example number",
                "type": "NUMBER",
                "value": "31415"
            },
            {
                "id_field_schema": 1,
                "name": "Example date",
                "type": "DATE",
                "value": "24/06/1983"
            },
            {
                "id_field_schema": 2,
                "name": "Example text",
                "type": "VARCHAR",
                "value": null
            },
            ...
      ]
    }
    

    This endpoint retrieves a specific member.

    HTTP Request

    POST https://api.berrly.com/v1/members/set-tag/{id_member}

    URL Parameters

    Parameter Description
    id_member The ID of the member to set attendance

    POST Parameters

    Parameter Options
    tags Comma separated values tags (ex: tag,example,football). Empty value will remove all tags.

    Tags

    Get All Tags

    curl "https://api.berrly.com/v1/tags"
      -H "Authorization: Bearer your_token_here"
    

    The above command returns JSON structured like this:

    [
        {
            "id_tag": 1,
            "name": "Player",
            "value": "player",
            "visibility": 1,
            "type": "MEMBERS",
            "group": "1"
        },
        {
            "id_tag": 2,...
        },
        {
            "id_tag": 3,...
        }
    ]
    

    This endpoint retrieves all tags.

    HTTP Request

    GET https://api.berrly.com/v1/tags

    Create a Tag

    curl -X POST "https://api.berrly.com/v1/tags"
      -H "Authorization: Bearer your_token_here"
      -d "name=Example"
    

    The above command returns JSON structured like this:

    {
        "name": "Example",
        "value": "example",
        "type": "MEMBERS",
        "id_tag": 1
    }
    

    This endpoint retrieves a specific event.

    HTTP Request

    POST https://api.berrly.com/v1/tags

    POST Parameters

    Parameter Description
    name The name of the tag

    Events

    Get All Events

    curl "https://api.berrly.com/v1/events"
      -H "Authorization: Bearer your_token_here"
    

    The above command returns JSON structured like this:

    [
      {
        "id_event": 1,
        "name": "European Cup Final",
        "group_name": null,
        "start": "1992-05-18 21:00:00",
        "duration": 60,
        "join_open": "1992-04-15 23:30:00",
        "join_close": "1992-05-18 10:00:00",
        "comments": "Lorem ipsum",
        "private_info": "Lorem ipsum",
        "address": "Wembley Stadium, London",
        "created_at": "1992-01-01 21:00:00",
        "updated_at": "1992-01-01 21:00:00",
        "type": ["tag-1","tag-2"],
        "attendance_tags": ["attendance-tag-1","attendance-tag-2"],
      }, 
      {
         "id_event": 2, ...
      },
      {
         "id_event": 3, ...
      }
    ]
    

    This endpoint retrieves all events.

    HTTP Request

    GET https://api.berrly.com/v1/events

    GET Parameters

    Parameter Description
    date upcoming, past or specific date (ex. 1992-05-18)

    https://api.berrly.com/v1/events?date=past https://api.berrly.com/v1/events?date=upcoming https://api.berrly.com/v1/events?date=1992-05-18

    Get a Specific Event

    curl "https://api.berrly.com/v1/events/{id_event}"
      -H "Authorization: Bearer your_token_here"
    

    The above command returns JSON structured like this:

    {
        "id_event": 1,
        "name": "European Cup Final",
        "group_name": null,
        "start": "1992-05-18 21:00:00",
        "duration": 60,
        "join_open": "1992-04-15 23:30:00",
        "join_close": "1992-05-18 10:00:00",
        "comments": "Lorem ipsum",
        "private_info": "Lorem ipsum",
        "address": "Wembley Stadium, London",
        "created_at": "1992-01-01 21:00:00",
        "updated_at": "1992-01-01 21:00:00",
        "type": ["tag-1","tag-2"],
        "attendance_tags": ["attendance-tag-1","attendance-tag-2"],
    
        "members": {
            "YES": [
                1,
                2,
                3,
                4,
                5
            ],
            "YES_VERIFIED": [
                1,
                2,
                3,
                4
            ],
            "NO": [
                6,
                7
            ],
            "NO_VERIFIED": [
                6,
                7,
                8
            ]
        }
    }
    

    This endpoint retrieves a specific event.

    HTTP Request

    GET https://api.berrly.com/v1/events/{id_event}

    URL Parameters

    Parameter Description
    id_event The ID of the event to retrieve

    Get a Specific Attendance

    curl "https://api.berrly.com/v1/events/{id_event}/member/{id_member}"
      -H "Authorization: Bearer your_token_here"
    

    The above command returns JSON structured like this:

    {
        "id_event": 1,
        "id_member": 3,
        "status": "YES",
        "status_verified": "YES",
        "companions": 0,
        "source": "ADMIN",
        "attendance_tags": ["tag-1","tag-2"],
        "created_at": "2017-04-07 19:00:00",
        "updated_at": "2017-04-07 20:00:00"
    }
    

    This endpoint retrieves a specific event.

    HTTP Request

    GET https://api.berrly.com/v1/events/{id_event}/member/{id_member}

    URL Parameters

    Parameter Description
    id_event The ID of the event to retrieve attendance
    id_member The ID of the member to retrieve attendance

    Set a Specific Attendance

    curl -X POST "https://api.berrly.com/v1/events/{id_event}/member/{id_member}"
      -H "Authorization: Bearer your_token_here"
      -d "parameter=value"
    

    The above command returns JSON structured like this:

    {
        "id_event": 1,
        "id_member": 3,
        "status": "YES",
        "status_verified": "YES",
        "companions": 0,
        "source": "ADMIN",
        "attendance_tags": ["tag-1","tag-2"],
        "created_at": "2017-04-07 19:00:00",
        "updated_at": "2017-04-07 20:00:00"
    }
    

    This endpoint retrieves a specific event.

    HTTP Request

    POST https://api.berrly.com/v1/events/{id_event}/member/{id_member}

    URL Parameters

    Parameter Description
    id_event The ID of the event to set attendance
    id_member The ID of the member to set attendance

    POST Parameters

    Parameter Options
    status YES / NO
    status_verified YES / NO
    attendance_tags ["tag-1","tag-2"] (json encoded array)

    Errors

    The Berrly API uses the following error codes:

    Error Code Meaning
    400 Bad Request -- Your request is invalid.
    401 Unauthorized -- Your API key is wrong.
    403 Forbidden -- The element requested is hidden for administrators only.
    404 Not Found -- The specified element could not be found.
    405 Method Not Allowed -- You tried to access a element with an invalid method.
    406 Not Acceptable -- You requested a format that isn't json.
    410 Gone -- The element requested has been removed from our servers.
    418 I'm a teapot.
    429 Too Many Requests -- You're requesting too many elements! Slow down!
    500 Internal Server Error -- We had a problem with our server. Try again later.
    503 Service Unavailable -- We're temporarily offline for maintenance. Please try again later.