Projet

Général

Profil

yousign.md

Analyse_AOR - Florian AZIZIAN, 30/04/2021 18:09

 
1
https://dev.yousign.com/#getting-started
2

    
3
USE CASE 1 (maarch courrier)
4
Action Envoyer au parapheur externe MP
5
Choix des personnes dans MP OU bouton ajouter un OTP
6
Nouvelle modale avec formulaire (choix d'un contact pour ses métadonnées)
7
Envoi a MP (step[0] user interne step[1] OTP)
8
{
9
	"steps": [
10
		{
11
			"action": "visa",
12
			"datePositions": [],
13
			"externalId": 4,
14
			"mainDocument": false,
15
			"resId": 24,
16
			"sequence": 0,
17
			"signatureMode": "visa",
18
			"signaturePositions": []
19
		},
20
		{
21
			"action": "sign",
22
			"datePositions": [],
23
			"otp": {
24
                "firstname": "John",
25
                "lastname": "Doe",
26
                "email": "john.doe@yousign.fr",
27
                "phone": "+33612345678"
28
            },
29
			"mainDocument": false,
30
			"resId": 24,
31
			"sequence": 1,
32
            "signatureMode": "otp",
33
			"signaturePositions": []
34
		}
35
	]
36
}
37

    
38
nouveau mode otp
39
nouvelle table otps 
40
id, user_id, firstname, lastname, email, phone, file_id, complement
41

    
42

    
43
Step 1 - Upload the files
44
The files on your server must be transferred to Yousign's infrastructure so that they can be processed. 
45

    
46
Once you have received the response from our API, you should store on your side the ID of the file. It will be necessary to link the procedure we will create to this document. 
47
In addition, it could be useful to download the signed document or to set up traceability on your side.
48

    
49
Finally, you will be able to link a file to only one procedure. If you want to create a new procedure with a file which is already linked with another procedure, you will receive an error from our API.
50

    
51
POST 
52
[object Object]/files
53

    
54
AUTHORIZATION Bearer Token
55
[object Object]token {{your-api-key}}
56

    
57
HEADERS
58
[object Object]Authorization Bearer {{your-api-key}}
59
Content-Type application/json
60

    
61
BODY
62
[object Object]{
63
    "name": "The best name for my file.pdf",
64
    "content": "JVBERi0xLjUKJb/3ov4KNiA [...] VPRgo="
65
}
66

    
67
RESPONSE
68
[object Object]{
69
  "id": "/files/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
70
  "name": "The best name for my file.pdf",
71
  "type": "signable",
72
  "contentType": "application/pdf",
73
  "description": null,
74
  "createdAt": "2018-12-01T11:36:20+01:00",
75
  "updatedAt": "2018-12-01T11:36:20+01:00",
76
  "sha256": "bb57ae2b2ca6ad0133a699350d1a6f6c8cdfde3cf872cf526585d306e4675cc2",
77
  "metadata": [],
78
  "workspace": "/workspaces/XXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
79
  "creator": null,
80
  "protected": false,
81
  "position": 0,
82
  "parent": null
83
}
84

    
85

    
86
Step 2 - Create the procedure
87

    
88
It's important to underline that email addresses need to have an existing domain. In addition, the phone numbers need to be valid numbers and follow the E.164 recommendation. Finally, please note that the page number of the documents starts at 1 and not 0.
89

    
90
POST 
91
[object Object]/procedures
92

    
93
AUTHORIZATION Bearer Token
94
[object Object]token {{your-api-key}}
95

    
96
HEADERS
97
[object Object]Authorization Bearer {{your-api-key}}
98
Content-Type application/json
99

    
100
BODY
101
[object Object]{
102
    "name": "My first procedure",
103
    "description": "Awesome! Here is the description of my first procedure",
104
    "members": [
105
        {
106
            "firstname": "John",
107
            "lastname": "Doe",
108
            "email": "john.doe@yousign.fr",
109
            "phone": "+33612345678",
110
            "fileObjects": [
111
                {
112
                    "file": "/files/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
113
                    "page": 2,
114
                    "position": "230,499,464,589",
115
                    "mention": "Read and approved",
116
                    "mention2": "Signed by John Doe"
117
                }
118
            ]
119
        }
120
    ]
121
}
122

    
123
RESPONSE
124
[object Object]{
125
  "id": "/procedures/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
126
  "name": "My first procedure",
127
  "description": "Awesome! Here is the description of my first procedure",
128
  "createdAt": "2018-12-01T11:49:11+01:00",
129
  "updatedAt": "2018-12-01T11:49:11+01:00",
130
  "finishedAt": null,
131
  "expiresAt": null,
132
  "status": "active",
133
  "creator": null,
134
  "creatorFirstName": null,
135
  "creatorLastName": null,
136
  "workspace": "/workspaces/XXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
137
  "template": false,
138
  "ordered": false,
139
  "parent": null,
140
  "metadata": [],
141
  "config": [],
142
  "members": [
143
    {
144
      "id": "/members/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
145
      "user": null,
146
      "type": "signer",
147
      "firstname": "John",
148
      "lastname": "Doe",
149
      "email": "john.doe@yousign.fr",
150
      "phone": "+33612345678",
151
      "position": 1,
152
      "createdAt": "2018-12-01T11:49:11+01:00",
153
      "updatedAt": "2018-12-01T11:49:11+01:00",
154
      "finishedAt": null,
155
      "status": "pending",
156
      "fileObjects": [
157
        {
158
          "id": "/file_objects/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
159
          "file": {
160
            "id": "/files/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
161
            "name": "The best name for my file.pdf",
162
            "type": "signable",
163
            "contentType": "application/pdf",
164
            "description": null,
165
            "createdAt": "2018-12-01T11:36:20+01:00",
166
            "updatedAt": "2018-12-01T11:49:11+01:00",
167
            "sha256": "bb57ae2b2ca6ad0133a699350d1a6f6c8cdfde3cf872cf526585d306e4675cc2",
168
            "metadata": [],
169
            "workspace": "/workspaces/XXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
170
            "creator": null,
171
            "protected": false,
172
            "position": 0,
173
            "parent": null
174
          },
175
          "page": 2,
176
          "position": "230,499,464,589",
177
          "fieldName": null,
178
          "mention": "Read and approved",
179
          "mention2": "Signed by John Doe",
180
          "createdAt": "2018-12-01T11:49:11+01:00",
181
          "updatedAt": "2018-12-01T11:49:11+01:00",
182
          "parent": null,
183
          "reason": "Signed by Yousign"
184
        }
185
      ],
186
      "comment": null,
187
      "notificationsEmail": [],
188
      "operationLevel": "custom",
189
      "operationCustomModes": [
190
        "sms"
191
      ],
192
      "operationModeSmsConfig": null,
193
      "parent": null
194
    }
195
  ],
196
  "subscribers": [],
197
  "files": [
198
    {
199
      "id": "/files/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
200
      "name": "The best name for my file.pdf",
201
      "type": "signable",
202
      "contentType": "application/pdf",
203
      "description": null,
204
      "createdAt": "2018-12-01T11:36:20+01:00",
205
      "updatedAt": "2018-12-01T11:49:11+01:00",
206
      "sha256": "bb57ae2b2ca6ad0133a699350d1a6f6c8cdfde3cf872cf526585d306e4675cc2",
207
      "metadata": [],
208
      "workspace": "/workspaces/XXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
209
      "creator": null,
210
      "protected": false,
211
      "position": 0,
212
      "parent": null
213
    }
214
  ],
215
  "relatedFilesEnable": false,
216
  "archive": false,
217
  "archiveMetadata": [],
218
  "fields": [],
219
  "permissions": []
220
}
221

    
222

    
223
Step 3 - Attach other files
224

    
225
This means that attachment files must be added after the creation of the procedure. You will not be able to add attachments until you have created the signing procedure.
226

    
227
POST 
228
[object Object]/files
229

    
230
AUTHORIZATION Bearer Token
231
[object Object]token {{your-api-key}}
232

    
233
HEADERS
234
[object Object]Authorization Bearer {{your-api-key}}
235
Content-Type application/json
236

    
237
BODY
238
[object Object]{
239
    "name": "Name of my attachment.pdf",
240
    "content": "JVBERi0xLjUKJb/3ov4KICA[...]VPRgo=",
241
    "procedure": "/procedures/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX",
242
    "type": "attachment"
243
}
244

    
245

    
246
PROBLÉMATIQUES
247

    
248
Comment paramétrer l'utilisateur OTP ?
249
nouveau bouton => Interface modal lors de la création du circuit ?
250

    
251
Ou stocker la clé API du compte YOUSIGN ?
252
Interface d'administration ?
253
Fichier de configuration serveur ?
254

    
255
Cohabiter les utilisateurs internes et les OTP ?
256
Un id user est lié à une ligne dans la table workflow
257
mettre id 0 plus mode => otp_yousign
258
nouvelle table otp
259

    
260
Quand lancer la procédure dans yousign ?
261
Si le circuit comporte des utilisateurs internes et OTP, il faudra lancer la procédure au moment de la validation du précédent user interne.
262

    
263
Comment savoir si l'OTP à fait une opération ?
264
Voir les webhook : https://dev.yousign.com/#127f4e4a-10f6-4310-9fcf-cb7c6fe2088a => maj de la table workflow
265

    
266
OTP avec synchro via MAARCH COURRIER ?
267
???
268

    
269
N.B : 
270
Les pages dans YOUSIGN commencent à 1 pas 0
271
Voir le référentiel pour la position de signature
272
position	Defines the coordinates of the signature image. You can go to How to calculate the coordinates of signature image? if you want to understand how to calculate the position. If you want to define the position manually, you can use our free tool on: https://placeit.yousign.fr.
273
Format : 
274
llx = X-axis (definition of horizontal size). This is the space from the left side of the page to the left side of the visual signature ("left lower x").
275
lly = Y-axis (height definition). This is the space from the bottom of the page to the bottom of the visual signature ("left lower y").
276
urx = X-axis (definition of horizontal size). This is the space from the left side of the page to the right side of the visual signature ("upper right x").
277
ury = Y-axis (height definition). This is the space from the bottom of the page to the top of the visual signature ("upper right y").
278

    
279
Algo : pour maarch  => llx == posX (en px) et ury == poxY (en px) ici blocHeight == 39 et blocWidth == 99
280
llx = (posX * docWidth) / 100
281
lly =  docHeight - (((posY * docHeight) / 100) + blocHeight)
282
urx = blocWidth + ((posY * docWidth) / 100)
283
ury = docHeight - ((posY * docHeight) / 100)
284

    
285

    
286
Pre-voir de génériser le code pour de futures connecteurs