10.3. Listing envelopes with cURLΒΆ

This example shows how company envelopes can be listed using bearer token for request authorization.

curl --location --request GET 'https://localhost:8081/api/v3/companies/by-id/aa69e1b4-a6ef-4a64-aa17-6c3f7adf8662/inboxes/by-id/4ebccdea-de80-42b6-b99e-2c821a121251/envelopes/list/' \
    --header 'Authorization: Bearer acaYpzlT7OL6gw1yI9W1ovtTZtFmQa'

If the bearer token is valid, the above cURL command returns a list of all Envelope objects that belong to this company, in JSON format. Below is an example of such a response:

[
    {
        "id": "b84acbfe-c55d-4f1f-bdd2-b121fa8f603c",
        "owner_id": "4ebccdea-de80-42b6-b99e-2c821a121251",
        "recipient_id": null,
        "message": "",
        "type": "outgoing",
        "created": "2020-08-03T07:30:01.328929Z",
        "sent": null,
        "archived": null,
        "delivered": null,
        "action_performed_by_id": null,
        "sealed": false,
        "can_be_sealed": false,
        "is_draft": true,
        "sender_inbox_id": null,
        "sender": null,
        "delivered_envelope_opened": false,
        "delivery_status": null,
        "can_be_archived": false,
        "can_be_unarchived": false,
        "read_by_user": false,
        "attachments": [
            {
                "id": "8a4c7ffb-774a-4025-be26-9f59efef42a9",
                "envelope_id": "b84acbfe-c55d-4f1f-bdd2-b121fa8f603c",
                "document_token_id": "e24b6aa0-0414-434a-a730-64d7b17f3c1b",
                "document_token": {
                    "id": "e24b6aa0-0414-434a-a730-64d7b17f3c1b",
                    "storage_type": "disk",
                    "watermark_generated": true,
                    "ipfs_document_group_id": null,
                    "ipfs_document_group": null,
                    "document_id": "9ebf2756-bc8b-454b-8fa7-e997b45e1a35",
                    "document": {
                        "id": "9ebf2756-bc8b-454b-8fa7-e997b45e1a35",
                        "current_owner_id": "4ebccdea-de80-42b6-b99e-2c821a121251",
                        "uploaded_by_id": "be6c5b4e-3d36-4a1f-9a8b-69a215518ccb",
                        "uploaded_by": {
                            "name": "John Doe",
                            "first_name": "John",
                            "last_name": "Doe",
                            "email": "[email protected]",
                            "telephone": null,
                            "company_id": "aa69e1b4-a6ef-4a64-aa17-6c3f7adf8662",
                            "company": {
                                "name": "Managed company",
                                "branch": null,
                                "address": "Sample street 123",
                                "address2": "",
                                "postal_code": "1234",
                                "city": "Ljubljana",
                                "country": "SI",
                                "country_name": "Slovenia",
                                "website": "https://cargox.io",
                                "vat_number": null,
                                "logo": null,
                                "logo_name": "",
                                "id": "aa69e1b4-a6ef-4a64-aa17-6c3f7adf8662"
                            },
                            "logo": null,
                            "logo_name": "",
                            "id": "be6c5b4e-3d36-4a1f-9a8b-69a215518ccb"
                        },
                        "type": {
                            "id": "GOO",
                            "name": "Guarantee of origin",
                            "short_name": "GOO",
                            "color": 20,
                            "categories": [
                                "Energy"
                            ],
                            "is_smart_bl": false,
                            "blockchain_support": "full",
                            "create_on_blockchain": true,
                            "transfer_on_blockchain": true,
                            "document_id_required": false,
                            "document_id_title": "Document ID",
                            "document_id_description": "Unique identification number of this document.",
                            "accomplisher_required": false,
                            "accomplisher_selectable": true,
                            "accomplisher_title": "Accomplisher",
                            "accomplisher_description": "An accomplisher completes the document and ends its workflow on the blockchain.",
                            "accomplish_action_string": "Accomplish",
                            "accomplish_review_step_title": "Accomplish document",
                            "accomplish_review_step_text": "Double-check the document below. To accomplish this document, click Next to continue.",
                            "accomplish_sign_step_title": "Sign and Accomplish document",
                            "accomplish_sign_step_text": "Click the Sign and Accomplish button to accomplish this document.",
                            "accomplish_sign_step_button": "Sign and Accomplish",
                            "accomplish_sign_in_progress_title": "Signing and Accomplishing of document is in progress.",
                            "accomplish_sign_success_message_title": "Document accomplish successful",
                            "accomplish_sign_success_message_text": "Document accomplished successfully. You can now close this window.",
                            "accomplish_sign_error_message_title": "Document accomplish failed",
                            "accomplish_sign_error_message_text": "An error occurred when accomplishing the document.  Please try again or contact support if error persists.",
                            "accomplish_notify_email_document_state": "Accomplished",
                            "accomplish_notify_email_subject_action": "Document accomplished",
                            "meta_tag_suggestions": [],
                            "issue_price_millicents": 400000,
                            "blockchain_transfer_limit": null,
                            "retention_period": "10 years"
                        },
                        "document_id": null,
                        "create_on_blockchain": true,
                        "create_on_blockchain_override": false,
                        "accomplisher_id": null,
                        "accomplisher": null,
                        "accomplished": null,
                        "accomplished_by_id": null,
                        "destroyed": null,
                        "destroyed_by_id": null,
                        "notify_parties": null,
                        "meta_data": null,
                        "display_name": "000671_2124311_potrdiloAo_30_07_2018_21_38_40_KXXOkj9_kYPMb8g (1).pdf",
                        "file_name": "000671_2124311_potrdiloAo_30_07_2018_21_38_40_KXXOkj9_kYPMb8g (1).pdf",
                        "file_size": 244950,
                        "file_content_type": "application/pdf",
                        "icon": "pdf",
                        "file_type": "PDF",
                        "created": "2020-08-03T07:30:03.099566Z",
                        "thumbnail": null,
                        "thumbnail_mime_type": null
                    },
                    "attachment_count": 1,
                    "is_on_blockchain": false,
                    "can_be_destroyed": false,
                    "can_be_accomplished": false,
                    "destroy_pending": false,
                    "accomplish_pending": false,
                    "created": "2020-08-03T07:30:03.542241Z"
                },
                "used_in_envelope_id": null,
                "used_in_envelope": null,
                "can_be_forwarded": false
            }
        ],
        "delivered_envelope_id": null,
        "failed_delivery_envelope_id": null,
        "failed_outgoing_id": null,
        "document_token_transactions": [],
        "pay_to_collect": false,
        "pay_to_collect_response": 0
    }
]

If bearer token is invalid or expired, the following 403 Forbidden response is returned:

{
    "detail": "Authentication credentials were not provided."
}