You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/dev/integration-cpp/index.md
+5-9Lines changed: 5 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,14 @@
1
-
# C++ Standalone Client Integration
1
+
# C++ API Client
2
2
[[toc]]
3
3
4
4
Do you want to integrate <MainPlatformNameLink />? <MainPlatformName /> is an open platform that aims to be developer friendly and it has been designed to allow easy integration with other software.
5
5
6
-
## C++ client installation
7
-
C++ client is completely without any dependencies. To install the C++ client, just download the binary for your platform from <GitHubRepoid="MerginMaps/cpp-api-client/releases"/> and use it from the command line.
6
+
## Installation
7
+
C++ API client is completely without any dependencies. To install the client, just download the binary for your platform from <GitHubRepoid="MerginMaps/cpp-api-client/releases"/> and use it from the command line.
8
8
9
-
Go to <GitHubRepoid="MerginMaps/cpp-api-client" /> repository for more information on how to use it.
9
+
The client uses Qt-based <GitHubRepoid="MerginMaps/mobile/tree/master/core"desc="Mergin Maps API core library" /> used by the <MainDomainNameLinkdesc="mobile app" /> to sync the projects in the mobile application. Go to <GitHubRepoid="MerginMaps/cpp-api-client" /> repository for more information on how to use it.
10
10
11
-
## Command line tool
11
+
## Command line interface
12
12
When the client is installed, it comes with `mergin` command line tool.
13
13
14
14
```bash
@@ -28,7 +28,3 @@ Commands:
28
28
sync Pull&Push the changes
29
29
remove Remove project from server.
30
30
```
31
-
32
-
## Mergin Maps API core library
33
-
34
-
C++ Client is based on the Qt-based <GitHubRepoid="MerginMaps/mobile/tree/master/core"desc="Mergin Maps API core library" /> used by the <MainDomainNameLinkdesc="Mergin Maps mobile app" /> to sync the projects in the mobile application.
Do you want to integrate <MainPlatformNameLink />? <MainPlatformName /> is an open platform that aims to be developer friendly and it has been designed to allow easy integration with other software.
5
9
6
-
## Python client module installation
7
-
The Python client module is the easiest way to programmatically use <MainPlatformNameLink />. You can use Python API or a command-line tool to easily work with <MainPlatformName /> projects, such as to get project status, push and pull changes, or to download, create and delete projects.
8
-
9
-
The <GitHubRepoid="MerginMaps/python-api-client" /> repository contains the source code of the Python client module and more information on how to use it.
10
+
## Installation
11
+
The Python client module is the easiest way to programmatically use <MainPlatformNameLink />. You can use Python API or a command-line tool to easily work with your projects, such as to get project status, push and pull changes. You can also create user accounts and manage their roles.
10
12
11
13
Python client is available in the PyPI repository and can be installed with `pip`:
12
14
13
15
```
14
16
pip3 install mergin-client
15
17
```
16
18
19
+
## Command line interface
20
+
For those who prefer using terminal, there is `mergin` command line tool shipped with the Python client. With several built-in commands, it is possible to download <MainPlatformName /> projects, push/pull changes, create or delete projects and more.
21
+
22
+
For example, to download a <MainPlatformName /> project to a local folder:
23
+
```
24
+
mergin download john/project1 ~/mergin/project1
25
+
```
26
+
For more details, visit <GitHubRepoid="MerginMaps/python-api-client" />.
27
+
17
28
## Python module
18
29
To use <MainPlatformNameLink /> from Python, just create `MerginClient` object and then use it. Here, for instance, to download a project:
19
30
@@ -30,132 +41,170 @@ import Mergin.mergin as mergin
The caller must be a workspace admin, owner or server administrator.
59
+
41
60
Arguments:
42
61
43
62
`email` (string): Must be a unique email.
44
63
45
64
`password` (string): Must meet security requirements.
46
65
47
-
`workspace_id` (int): The workspace ID where the user will be added.
66
+
`workspace_id` (int)⭐️ : The workspace ID where the user will be added.
48
67
49
-
`workspace_role`(string): The user’s role in the workspace. [See the roles options](../../manage/permissions.md).
68
+
`workspace_role`(string)⭐️ : The user’s role in the workspace. [See the roles options](../../manage/permissions.md#workspace-member-roles-overview).
50
69
51
-
`username` (string, optional): Custom username; if not provided, it will be automatically generated.
70
+
`username` (string, optional): If not provided, it will be automatically generated from the email address.
52
71
53
-
`notify_user` (Boolean, optional): Flag for email notifications (invitations, access requests etc.). Default is `False`.
72
+
`notify_user` (Boolean, optional): If true, confirmation email and other email communication will be sent to the email address (invitations, access requests etc.). Default is `False`.
`workspace_id` (int): Workspace ID from which to remove the user.
135
+
`workspace_id` (int): ID of the workspace.
136
+
137
+
`user_id` (int): ID of the user.
138
+
139
+
> Note: the user account is not removed. This method only removes their access to the workspace.
140
+
141
+
---
142
+
143
+
### Project collaborators methods
144
+
145
+
These methods are available for all server types.
146
+
147
+
::: warning API availability
148
+
The following methods are available for Python API Client versions `0.10.0` or higher, using server versions `2025.2.0` or higher.
149
+
:::
103
150
104
-
`user_id` (int): ID of the user to be removed.
151
+
The caller of the following methods must be a workspace admin, owner, project owner or server administrator.
105
152
106
-
### Get a list of project collaborators
153
+
The following methods accept project ids (of type `uuid`). You can find project id via [projects_list](https://github.com/MerginMaps/python-api-client/blob/634237890afd9f28f03953e5a01376b56f5abf5c/mergin/client.py#L572) and [project_info](https://github.com/MerginMaps/python-api-client/blob/634237890afd9f28f03953e5a01376b56f5abf5c/mergin/client.py#L642) methods.
154
+
155
+
#### List project collaborators
107
156
108
157
```python
109
158
client.list_project_collaborators(<project_id>)
110
159
```
111
160
Arguments:
112
161
113
-
`project_id` (string): Project ID to list the users.
162
+
`project_id` (string): ID of the project.
163
+
164
+
#### Add project collaborator
114
165
115
-
### Add a user to project
166
+
Adds a user as project collaborator. This method is good for sharing projects with guests or upgrading roles of members for specific projects.
167
+
On Cloud, the user must be a in the workspace where the project belongs.
`project_id` (string): Project ID in which the role will be updated.
187
+
`project_id` (string): ID of the project.
136
188
137
-
`user_id` (int): ID of the user to update.
189
+
`user_id` (int): ID of the user.
138
190
139
-
`project_role`: (string): New role.
191
+
`project_role`: (string): New role.[See the roles options](../../manage/permissions.md##project-permissions-overview)
140
192
141
-
Note that the user must have a project role to update it. You can create one using the previous method.
193
+
> Note: the user must be first added to the project (via [Add project collaborator](./index.md#add-project-collaborator)) before calling this method, even if he/she is already a workspace member or guest.
`project_id` (string): Project ID to remove the user.
202
+
`project_id` (string): ID of the project.
151
203
152
-
`user_id` (int): ID of the user to remove from the project.
204
+
`user_id` (int): ID of the user.
153
205
154
-
## Command line interface
155
-
For those who prefer using terminal, there is `mergin` command line tool shipped with the Python client. With several built-in commands, it is possible to download <MainPlatformName /> projects, push/pull changes, create or delete projects and more.
206
+
> Note: the user account is not removed, only the project access.
156
207
157
-
For example, to download a <MainPlatformName /> project to a local folder:
158
-
```
159
-
mergin download john/project1 ~/mergin/project1
160
-
```
161
-
For more details, visit <GitHubRepoid="MerginMaps/python-api-client" />.
208
+
## Further details
209
+
210
+
The <GitHubRepoid="MerginMaps/python-api-client" /> repository contains the source code and more information on how to use it.
0 commit comments