This tutorial is in order to send your first P2 requests request using the version 1.0 of Sandbox Botdoc API. In order to use this version, you have to put “v1” on the API’s endpoint.
To a better understanding about the versioning, please go to https://api.botdoc.io/documentation/#section/Get-Started/Versioning
and to a better understanding about the Sandbox, please go to https://api.botdoc.io/documentation/#section/Get-Started/Sandbox-Platform
Instructions
The first thing you need to understand is every request MUST have a token:
Thus, no matter what endpoint, you always need to pass the token on the header that looks like the following:
Authorization: JWT your-token-here
1 - Create a Container:
Botdoc P2 Container is a session with multiple secure Features inside of it, with P2 you can make a Flow automation or just a simple file "push", "pull", “DocuSign” or “DocuSign”“External URL”.
Endpoint: https://sandboxapiapi.botdoc.io/v1/module_container/container/
Method: POST.
Example of the body in JSON format:
Code Block |
---|
|
{
"page_type": "p2",
"callback_url": "https://link.to.your.callback.url",
"display_chat": true
} |
Example how to create a Container by cURL:
Code Block |
---|
|
curl -i --request POST "https://sandboxapiapi.botdoc.io/v1/module_container/container/" \
--header "Authorization: JWT <Authorization Token>" \
--header "Content-Type: application/json" \
--data-raw "{
"page_type": "p2",
"callback_url": "https://link.to.your.callback.url",
"display_chat": true
}" |
1.2 -
...
Create a Container with a Requester:
To create a Container with a Requester attached, is simple, first of all, you need to create the Recipient(s) of your Secure Container.a Requester, if you don't have any Requester registered, follow the link: How to create a Requester
After that, we need to create a new Container adding our Requester, the process is simple, follow:
Endpoint: https://sandboxapiapi.botdoc.io/v1/module_container/container/{container_id}/recipient/
Method
Method: POST.
Example of the body in JSON format:
Code Block |
---|
|
{
"firstpage_nametype": "Johnp2",
"last_namerequester": "Smith"{requester_id}
} |
Example how to create a Container with a Requester by cURL:
Code Block |
---|
|
curl -i --request POST "https://sandboxapiapi.botdoc.io/v1/module_container/container/{container_id}/recipient/" \
--header "Authorization: JWT <Authorization Token>" \
--header "Content-Type: application/json" \
--data-raw "{
"firstpage_nametype": "Johnp2",
"last_namerequester": "Smith"{requester_id}
}
" |
3 - Define your RecipientItem(s)
...
Note |
---|
Remember that, whenever a Container with a Requester attached to it is sent, the Requester is duplicated to a table RequesterContainer, to keep the data concise with the data on the day and time of the Container was sent, in case of this requester is modified or even deleted. |
2 - Define Recipient(s):
After the Secure Container was created, you need to create the Recipient(s) of your Secure Container.
Endpoint: https://api.botdoc.io/v1/module_container/recipientcontainer/{recipientcontainer_id}/recipient_item/
Method: POST.
Example of the body in JSON format:
Code Block |
---|
|
{
"interfacefirst_classname": "emailJohn",
//can be "email" or "sms"
"valuelast_name": "myemail@botdoc.ioSmith"
} |
Example how to create a Container Recipient by cURL:
Code Block |
---|
|
curl -i --request POST "https://sandboxapiapi.botdoc.io/v1/module_container/recipientcontainer/{recipientcontainer_id}/recipient_item/" \
--header "Authorization: JWT <Authorization Token>" \
--header "Content-Type: application/json" \
--data-raw "{
"interfacefirst_classname": "emailJohn",
"valuelast_name": "myemail@botdoc.ioSmith"
}
" |
4 - Set an AuthCode
...
3 - Define your RecipientItem(s)
Now, we need to add our RecipientItem linked to the Recipient in the Step 2.
Endpoint: https://sandboxapiapi.botdoc.io/v1/module_container/authcode/recipient/{recipient_id}/recipient_item/
Method: POST.
Example of the body in JSON format:
Code Block |
---|
|
{
"container": "{container_id}",
"send_asinterface_class": "email", //can be "email" or "sms"
"tovalue": "myemail@botdoc.io"
} |
Example how to create an AuthCode a Recipient Item by cURL:
Code Block |
---|
|
curl -i --request POST "https://sandboxapiapi.botdoc.io/v1/module_container/authcode/recipient/{recipient_id}/recipient_item/" \
--header "Authorization: JWT <Authorization Token>" \
--header "Content-Type: application/json" \
--data-raw "{
"container": "{container_id}",
"send_asinterface_class": "email",
"tovalue": "myemail@botdoc.io"
}
" |
...
4 - Set an AuthCode
Now, you must inform the Email Message if in the previewer step the transport method was sent to Email, if you want, you can protect your Secure Container with Two Factor Authentication.
Endpoint: https://sandboxapiapi.botdoc.io/v1/module_container/container/{container_id}/emailauthcode/
Method: POST.
Example of the body in JSON format:
Code Block |
---|
|
{
"subjectcontainer": "nice subject{container_id}",
"bodysend_as": "email"a, nice//can messagebe here"email"
} |
...
or "sms"
"to": "myemail@botdoc.io"
} |
Example how to create an Email message AuthCode by cURL:
Code Block |
---|
|
curl -i --request POST "https://sandboxapiapi.botdoc.io/v1/module_container/container/{container_id}/emailauthcode/" \
--header "Authorization: JWT <Authorization Token>" \
--header "Content-Type: application/json" \
--data-raw "{
"subjectcontainer": "nice subject{container_id}",
"bodysend_as": "a nice message here"
}" |
...
"email",
"to": "myemail@botdoc.io"
}" |
5 - Define Email Message
Now, you must inform the SMS Email Message if in the previewer step , the transport method was sent to SMSEmail.
Endpoint: https://sandboxapiapi.botdoc.io/v1/module_container/container/{container_id}/smsemail/
Method: POST.
Example of the body in JSON format:
Code Block |
---|
|
{
"subject": "nice subject",
"body": "a nice bodymessage here"
} |
Example how to create an SMS Email message by cURL:
Code Block |
---|
|
curl -i --request POST "https://sandboxapiapi.botdoc.io/v1/module_container/container/{container_id}/smsemail/" \
--header "Authorization: JWT <Authorization Token>" \
--header "Content-Type: application/json" \
--data-raw "{
"subject": "nice subject",
"body": "a nice bodymessage here"
}" |
...
6 - Define SMS Message
Now, you must add a feature, can be Pull, Push or DocuSign, see 3 examples below:
7.1 - Pull Feature
If you want to request file(s) from your receiver, you must send a Pull Feature:inform the SMS Message if in the previewer step, the transport method was sent to SMS.
Endpoint: https://sandboxapiapi.botdoc.io/v1/module_container/container/{container_pullid}/pullsms/
Method: POST.
Example of the body in JSON format:
Code Block |
---|
|
{
"containerbody": {container_id},
"title": "Nice Pull Title",
"description": "Nice Pull Desc.a nice body here"
} |
Example how to create a Pull Feature an SMS message by cURL:
Code Block |
---|
|
curl -i --request POST "https://sandboxapiapi.botdoc.io/v1/module_container_pull/pull/container/{container_id}/sms/" \
--header "Authorization: JWT <Authorization Token>" \
--header "Content-Type: application/json" \
--data-raw "{
"containerbody": {container_id},
"title": "Nice Pull Title",
"description": "Nice Pull Desc.a nice body here"
}" |
7
...
-
...
Add Features
Now, you must add a feature, can be Pull, Push or DocuSign, see 3 examples below:
7.1 - Pull Feature
If you want to request file(s) to FROM your Receiverreceiver, you must send a Push Pull Feature:
Endpoint: https://sandboxapiapi.botdoc.io/v1/module_container_pushpull/pushpull/
Method: POST.
Example of the body in JSON format:
Code Block |
---|
|
{
"container": {container_id},
"title": "Nice PushPull Title",
"description": "Nice PushPull Desc.",
"max_file_downloads": 4
} |
Example how to create a Push Pull Feature by cURL:
Code Block |
---|
|
curl -i --request POST "https://sandboxapiapi.botdoc.io/v1/module_container_pushpull/pushpull/" \
--header "Authorization: JWT <Authorization Token>" \
--header "Content-Type: application/json" \
--data-raw "{
"container": {container_id},
"title": "Nice PushPull Title",
"description": "Nice PushPull Desc.",
"max_file_downloads": 4
}" |
7.2
...
- Push
...
Feature
If you want to request documentSEND file(s) from to your receiverReceiver, you must send a Push Feature and obligatorily a Push File:
Endpoint: https://sandboxapiapi.botdoc.io/v1/module_container_push/pushfilepush/
Method: POST.
Example of the body in JSON format:
Code Block |
---|
|
{
"filecontainer": "<your file>"{container_id},
"nametitle": "invoice_2020.pdfNice Push Title",
"pushdescription": {push_id} "Nice Push Desc.",
"totalmax_file_chunksdownloads": 14
} |
Example how to create a PushFile Push Feature by cURL:
Code Block |
---|
|
curl -i --request POST "https://sandboxapiapi.botdoc.io/v1/module_container_push/pushfilepush/" \
--header "Authorization: JWT <Authorization Token>" \
--header "Content-Type: multipartapplication/form-datajson" \
--data-formraw "file=@C:\invoices\invoice_2020.pdf" \
--form "name=invoice_2020.pdf" \
--form "push={push_id}" \
--form "total_chunks=1" |
7.3 - DocuSign Feature
...
{
"container": {container_id},
"title": "Nice Push Title",
"description": "Nice Push Desc.",
"max_file_downloads": 4
}" |
7.2.1 - Push File Feature
If you want to SEND file(s) to your Receiver, you must send a Push Feature and a Push File (required):
Endpoint: https://sandboxapiapi.botdoc.io/v1/module_container_docusignpush/docusignpushfile/
Method: POST.
Example of the body in JSON format:
Code Block |
---|
|
{
"titlefile": "<your file>"Sign,
this doc. pls",
"descriptionname": "this document allows you to get an bank loaninvoice_2020.pdf",
"envelopepush": {
push_id},
"templatetotal_idchunks": "f53858a0-4810-492a-aba7-8dda6eb83ffc",
"recipients": {
"signers": [
{
"name": "John Smith",
"email": "myemail@botdoc.io1
} |
Example how to create a PushFile Feature by cURL:
Code Block |
---|
|
curl -i --request POST "https://api.botdoc.io/v1/module_container_push/pushfile/" \
--header "Authorization: JWT <Authorization Token>" \
--header "Content-Type: multipart/form-data" \
--form "file=@C:\invoices\invoice_2020.pdf" \
--form "name=invoice_2020.pdf" \
--form "push={push_id}" \
--form "total_chunks=1" |
7.3 - DocuSign Feature
If you want the Receiver to Sign something, you must send a DocuSign Feature:
Endpoint: https://api.botdoc.io/v1/module_container_docusign/docusign/
Method: POST.
Example of the body in JSON format:
Code Block |
---|
|
{
"title": "Sign this doc. pls",
"description": "this document allows you to get an bank loan",
"envelope": {
"client_usertemplate_id": "{recipient_id}f53858a0-4810-492a-aba7-8dda6eb83ffc",
"recipients": {
"role_namesigners": "Signer"[
}{
] "name": "John Smith",
} }, "containeremail": {container_id}
} |
Example how to create a DocuSign Feature by cURL:
Code Block |
---|
|
curl -i --request POST "https://sandboxapi.botdoc.io/v1/module_container_docusign/docusign/" \
--header "Authorization: JWT <Authorization Token>" \
--header "Content-Type: application/json" \
--data-raw "{"myemail@botdoc.io",
"titleclient_user_id": "Sign this doc. pls",{recipient_id}",
"description": "this document allows you to get an bank loan", "role_name": "envelopeSigner":
{ "template_id": "f53858a0-4810-492a-aba7-8dda6eb83ffc", }
"recipients": { ]
"signers": [ }
},
"container": {container_id}
} |
Example how to create a DocuSign Feature by cURL:
Code Block |
---|
|
curl -i "name": "John Smith",
--request POST "https://api.botdoc.io/v1/module_container_docusign/docusign/" \
--header "Authorization: JWT <Authorization Token>" \
--header "Content-Type: application/json" \
--data-raw "{
"title": "Sign this doc. pls",
"description": "this document allows you to get an bank loan",
"envelope": {
"template_id": "f53858a0-4810-492a-aba7-8dda6eb83ffc",
"recipients": {
"signers": [
{
"name": "John Smith",
"email": "myemail@botdoc.io",
"client_user_id": "{recipient_id}",
"role_name": "Signer"
}
]
}
},
"container": {container_id}
}" |
7.4 - External URL Feature
If you want to send some link(s) to your receiver, you must send a External URL, the URL in the body must have a https:// prefix.
Endpoint: https://api.botdoc.io/v1/module_container_iframe/iframe/
Method: POST.
Example of the body in JSON format:
Code Block |
---|
|
{
"emailcontainer": "myemail@botdoc.io"{container_id},
"title": "Nice External URL Title",
"client_user_iddescription": "{recipient_id}",
Nice External URL Description",
"url": "https://botdoc.io/"
} |
Example how to create a External URL Feature by cURL:
Code Block |
---|
|
curl -i --request POST "role_name": "Signer"
https://api.botdoc.io/v1/module_container_iframe/iframe/" \
--header "Authorization: JWT <Authorization Token>" \
--header "Content-Type: application/json" \
--data-raw "{
}"container": {container_id},
"title": "Nice ]
External URL Title",
} "description": "Nice External URL }Description",
"containerurl": {container_id}"https://botdoc.io/"
}" |
8 - Send the Notification to the Receiver(s)
Now, just send the Notification to the Receiver(s).
Endpoint: https://sandboxapiapi.botdoc.io/v1/module_container/container/{container_id}/send_notification/
Method: POST.
Example how to send a notification by cURL:
Code Block |
---|
|
curl -i --request POST "https://sandboxapiapi.botdoc.io/v1/module_container/container/{container_id}/send_notification/" \
--header "Authorization: JWT <Authorization Token>" \
--header "Content-Type: application/json" \
--data-raw "" |
...
Related articles
Filter by label (Content by label) |
---|
showLabels | false |
---|
max | 5 |
---|
spaces | com.atlassian.confluence.content.render.xhtml.model.resource.identifiers.SpaceResourceIdentifier@75205211 | showSpace | false |
---|
sort | modified |
---|
typeshowSpace | pagefalse |
---|
reverse | true | labels |
---|
kb-how-to-articletype | page | cql | label = "kb-how-to-article" and type = "page" and space = "BOTDOC" |
---|
labels | kb-how-to-article |
---|
|
...