Movidesk API - Activities
6 min
Created by Movidesk on 7/2/2019 4:26 PM
Updated by Karine Moreira on 9/24/2024 4:26 PM
Important: Our APIs have a limit of 10 requests per minute to ensure healthy usage. If you have a specific scenario that requires increasing usage, please contact our support team for a feasibility analysis. Learn more about API schedules and limits
https://api.movidesk.com/public/v1

This API can be used together with the Hours Contract API.

Activities

URL: /activity
Methods: GET / POST / PATCH / DELETE
Property Type Size Required Description
Id int     Activity reference code.
activityDto activityDto     Object containing the fields of the created activity.
data activityDto     Fields that will be modified in the activity.

 

activityDto

Property Type Size Required Description
Id int     Activity reference code (read-only).
Name string 128 Activity name.
IsActive bool     Whether the activity is active or not.
IsAllowsAllTeams bool     Whether the activity is available to all teams.
Teams array   *

*Required when IsAllowsAllTeams=false

Teams with existing names are not allowed.

 

URL: /addTeamsToActivity
Methods: POST
Property Type Size Required Description
activityId int     Activity reference code.
teams array     Teams.

 

GET Method

GET: /activity

Parameters: id, token

Example: Retrieving activity with id 1

GET: https://api.movidesk.com/public/v1/activity?token=c4f511ca-83e5-4155-9d01-325fa3ab3738&id=1

Response:

{
    "id": 1,
    "name": "Teste 3",
    "isActive": true,
    "isAllowsAllTeams": false,
    "teams":
    [
        {
            "name": "Administradores"
        }
    ]
}

 

Retrieving activities with pagination:

GET: /activity/

Parameters: token

Optional parameters: limit, startingAfter, name

Parameters:

limit A limit on the number of objects to be returned, between 1 and 100. (default: 100)
startingAfter A cursor for use in pagination. startingAfter is an object ID that defines your place in the list. For example, if you make a request and receive 100 objects, ending with 100, in your subsequent call you can include the parameter startingAfter=100 to fetch the next page. (optional)
name Activity name
Response:
hasMore Whether there are more elements available after this set. If false, it is understood as the end of the list.
items An array containing the activities of the current page.

Example: Retrieving a limit of three activities that contain "Activity" in the name

GET: https://api.movidesk.com/public/v1/activity?token=2A1D2F6C-0AF0-440C-A743-AF7910BEA185&limit=3&name=activity

Response:

{
"hasMore": true,
"items": [
{
"id": 371,
"name": "Activity number two",
"isActive": true,
"isAllowsAllTeams": false,
"teams": [
{
"name": "Sales"
},
{
"name": "Development / Maintenance"
}
]
},
{
"id": 370,
"name": "Activity",
"isActive": true,
"isAllowsAllTeams": true,
"teams": []
},
{
"id": 369,
"name": "Activity number three",
"isActive": true,
"isAllowsAllTeams": true,
"teams": []
}
]
}

 

POST Method

POST: /activity

Parameters: token

Headers: Content-Type: application/json

Post body: {JSON object}

Example:

POST: http://api.movidesk.com/public/v1/activity?token=c4f511ca-83e5-4155-9d01-325fa3ab3738

Headers: Content-Type: application/json
RequestBody:
{
"name": "activity",
"isActive": true,
"isAllowsAllTeams": false,
"teams":
[
{
"name": "Administrators"
},
{
"name": "Support"
}
]
}
 
Response: Status 200 and the id of the created activity

PATCH Method

PATCH: /activity

Parameters: id, token

Headers: Content-Type: application/json

Post body: {JSON object}

Example: Changing the name and teams of the activity with id 1

POST: http://api.movidesk.com/public/v1/activity?token=c4f511ca-83e5-4155-9d01-325fa3ab3738&id=1

RequestBody:
{
"name": "updated activity",
 
"teams":
[
{
"name": "Team"
}
]
}
 
Response: Status 200 and the id of the updated activity

DELETE Method

DELETE: /activity

Parameters: id, token

Example: Deleting the activity with id 1

DELETE: http://api.movidesk.com/public/v1/activity?token=c4f511ca-83e5-4155-9d01-325fa3ab3738&id=1

Response: Status 200 and the id of the deleted activity

 

POST Method

POST: /addTeamsToActivity

Parameters: activityId, token

Headers: Content-Type: application/json

Post body: {JSON object}

Example: Adding the "Support" team to the activity with id 1

POST: http://api.movidesk.com/public/v1/addTeamsToActivity?token=155cac97-f203-4bb8-86e1-aa4cb8781f3e&activityId=380

RequestBody:
[
"Support"
]
 
Response: Status 200 and an array with all the teams of the updated activity after adding the teams