FansquareAPI reference
Open the app

Planning

Read one employee of the planning

GET/v1/planning/team/{employee_id}

One member, with the ids of the creators they reach and of the creators of their work profile.

Required scoperead:planning
Rate limit30 requests per minute
curl 'https://api.fansquare.so/v1/planning/team/9926b1f9-74a9-4ab5-a716-1c14f6bcc475' \
  -H "Authorization: Bearer $API_KEY" \
  -H "Fansquare-Version: Amethyste"
{
  "timezone": "Europe/Paris",
  "named_shifts": [
    {
      "id": "5afc7856-2404-4a6c-a7e5-5042b84bf795",
      "name": "Lena",
      "start_time": "string",
      "end_time": "string"
    }
  ],
  "data": [
    {
      "id": "9926b1f9-74a9-4ab5-a716-1c14f6bcc475",
      "name": "Lena",
      "role_name": "string",
      "is_owner": true,
      "platforms": [
        "string"
      ],
      "role_platforms": [
        "string"
      ],
      "all_creators": true,
      "creators_count": 12,
      "creator_ids": [
        "m81IhLxdhzDGYs54rNp2"
      ],
      "work_profile": {
        "slots": [
          {
            "named_shift_id": "5afc7856-2404-4a6c-a7e5-5042b84bf795",
            "start_time": "string",
            "end_time": "string",
            "week_days": [
              "string"
            ],
            "named_shift_name": "string"
          }
        ],
        "creators_count": 12,
        "creator_ids": [
          "m81IhLxdhzDGYs54rNp2"
        ]
      }
    }
  ]
}

Parameters

Headers

  • Fansquare-Versionstringrequired

    API version to pin. Accepts the mineral name or the release date of a version.

Path

  • employee_idstringrequired

    Fansquare user id.

    min length 1max length 128

Response

OK, application/json

  • timezonestringrequired

    The agency time zone (IANA): every date and time of this answer is read in it.

  • named_shiftsarray of objectsrequired

    The named shifts of the agency.

    • idstringrequired

      Named shift id (Settings › Planning of the app).

    • namestringrequired

      Name of the shift, such as « Matin ».

    • start_timestringrequired

      Start, HH:mm.

    • end_timestringrequired

      End, HH:mm; before the start means the next day.

  • dataarray of objectsrequired

    The active members of the agency.

    • idstringrequired

      Fansquare user id.

    • namestringrequired

      Display name.

    • role_namestring | nullrequired

      Name of their agency role.

    • is_ownerbooleanrequired

      The owner of the agency.

    • platformsarray of stringsrequired

      The platforms they work on (the coverage counts them there).

    • role_platformsarray of stringsrequired

      The platforms their role opens.

    • all_creatorsbooleanrequired

      Reaches every creator (owner, Associate).

    • creators_countintegerrequired

      Number of creators they reach.

    • creator_idsarray of strings

      The creators they reach (GET /v1/planning/team/{employee_id} only).

    • work_profileobjectrequired

      The work profile: the weekly hours that make their recurring shifts.

      • slotsarray of objectsrequired

        Their weekly hours.

        • named_shift_idstring | nullrequired

          A named shift, or null for hours given directly.

        • start_timestringrequired

          Start, HH:mm.

        • end_timestringrequired

          End, HH:mm.

        • week_daysarray of stringsrequired

          Days of these hours: MO, TU, WE, TH, FR, SA, SU.

        • named_shift_namestring | nullrequired
      • creators_countintegerrequired

        Creators of the profile.

      • creator_idsarray of strings

        The creators of the profile (one employee only).

curl 'https://api.fansquare.so/v1/planning/team/9926b1f9-74a9-4ab5-a716-1c14f6bcc475' \
  -H "Authorization: Bearer $API_KEY" \
  -H "Fansquare-Version: Amethyste"
{
  "timezone": "Europe/Paris",
  "named_shifts": [
    {
      "id": "5afc7856-2404-4a6c-a7e5-5042b84bf795",
      "name": "Lena",
      "start_time": "string",
      "end_time": "string"
    }
  ],
  "data": [
    {
      "id": "9926b1f9-74a9-4ab5-a716-1c14f6bcc475",
      "name": "Lena",
      "role_name": "string",
      "is_owner": true,
      "platforms": [
        "string"
      ],
      "role_platforms": [
        "string"
      ],
      "all_creators": true,
      "creators_count": 12,
      "creator_ids": [
        "m81IhLxdhzDGYs54rNp2"
      ],
      "work_profile": {
        "slots": [
          {
            "named_shift_id": "5afc7856-2404-4a6c-a7e5-5042b84bf795",
            "start_time": "string",
            "end_time": "string",
            "week_days": [
              "string"
            ],
            "named_shift_name": "string"
          }
        ],
        "creators_count": 12,
        "creator_ids": [
          "m81IhLxdhzDGYs54rNp2"
        ]
      }
    }
  ]
}