This tutorial is in order to Delete a Recipient Item from a created Container.

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 “External URL”.

Endpoint: https://api.botdoc.io/v1/module_container/container/ 
Method: POST.

Example of the body in JSON format:

{
    "page_type": "p2",
    "callback_url": "https://link.to.your.callback.url",
    "display_chat": true
}

Example how to create a Container by cURL:

curl -i --request POST "https://api.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
}"

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/container/{container_id}/recipient/
Method: POST.

Example of the body in JSON format:

{
   "first_name": "First",
   "last_name": "Receiver"
}

Example how to create a Recipient by cURL:

curl -i --request POST "https://api.botdoc.io/v1/module_container/container/{container_id}/recipient/" \
--header "Authorization: JWT <Authorization Token>" \
--header "Content-Type: application/json" \
--data-raw "{
   "first_name": "First",
   "last_name": "Receiver"
}
"

3 - Define your RecipientItem(s)

3.1 - Add the First Recipient Item for the Recipient:

Now, you need to add your first RecipientItem linked to the Recipient in Step 2.
Endpoint: https://api.botdoc.io/v1/module_container/recipient/{recipient_id}/recipient_item/
Method: POST.

Example of the body in JSON format:

{
   "interface_class": "email", //can be "email" or "sms"
   "value": "myemail@botdoc.io"
}

Example how to create a first Recipient Item by cURL:

curl -i --request POST "https://api.botdoc.io/v1/module_container/recipient/{recipient_id}/recipient_item/" \
--header "Authorization: JWT <Authorization Token>" \
--header "Content-Type: application/json" \
--data-raw "{
   "interface_class": "email",
   "value": "myemail@botdoc.io"
}
"

3.2 - Add the Second Recipient Item for the Recipient:

Now, you need to add your second RecipientItem linked to the Recipient in the Step 2.
Endpoint: https://api.botdoc.io/v1/module_container/recipient/{recipient_id}/recipient_item/
Method: POST.

Example of the body in JSON format:

{
   "interface_class": "sms", //can be "email" or "sms"
   "value": "000000000000"
}

Example how to create a second Recipient Item by cURL:

curl -i 
--request POST "https://api.botdoc.io/v1/module_container/recipient/{recipient_id}/recipient_item/" \
--header "Authorization: JWT <Authorization Token>" \
--header "Content-Type: application/json" \
--data-raw "{
   "interface_class": "sms",
   "value": "000000000000"
}
"

4 - Remove the Recipient Item From a Container:

Now, you need to remove your RecipientItem linked to the Recipient in the Step 2.
Endpoint: https://api.botdoc.io/v1/module_container/recipientitem/{id}/
Method: POST.

Example of the body in JSON format:

Example how to delete a Recipient Item by cURL:

curl -i 
--request DELETE "https://api.botdoc.io/v1/module_container/recipientitem/{id}/" \
--header "Authorization: JWT <Authorization Token>" \
--header "Content-Type: application/json" \
"

For more details about creating a requests you can take a look at our Botdoc API Reference on api.botdoc.io/documentation/#create-request

Related articles