Answered

Sharing Employee's document with another application


Hi 

I am working on another application, that wishes to retrieve Personio’s uploaded document. And wish to understand what is the best way to integrate. 

  1. if another application wishes to access Peronio’s one selected employee’s document, what API do I use? 
  2. Am I able to obtain an URL for that Personio document, so that the other application can use that link load that document or do I need to export that Personio Document into my application?
  3. I noticed that there is an API that requires the document_ID, how to I retrieve a selected employee’s document_IDs?  (https://developer.personio.de/v2.0/reference/get_v2-document-management-documents-document-id-download)
  4. If that employee has 3 documents, and i wish to obtain one of the document, based on the category or a key, which API do you suggest?
icon

Best answer by International Support Team 7 June 2024, 10:44

View original

3 replies

Userlevel 6

Hi @itnewbie,

Every document uploaded to an employee’s profile has a Document ID. You can retrieve this ID by going to the Document section of the employee’s profile and clicking on the document. You will see at the end of the URL “documentId=” followed by a number. This number is the Document ID that you can use for the API. 

Regarding connecting your integration, you can check out the Personio Marketplace to see if you want to use an existing integration or if you wish to connect a Custom integration, please see details in this Help Center article: Build your own integration with our APIs

Thanks for your query and let me know if you have further questions. 😀

Best,

Steve

Hi Steve

Thanks for your reply. By the way, the Document ID you described above, is retrieved as a user using the Personio application. Is a developer able to obtain the Document ID, via an API passing in a parameter such as “Name” or “EmployeeID” or any other fields for a specific employee,etc?

Thanks in advance,

Lynn

Userlevel 6

Hi @itnewbie

Yes, you can do this using our v2 Document Management API. Specifically the "list document metadata" endpoint. This allows you to include the owner_id as a query parameter which is the ID of an employee in Personio. It will return metadata (including the name) relating to the document. For example with an employee with ID 23788456 we can make the following request: 

GET https://api.personio.de/v2/document-management/documents?owner_id=23788456
HEADERS Authorisation Bearer {{authToken}}

RESPONSE
{
    "_data": [
        {
            "id": "95414029",
            "name": "test",
            "date": "2024-07-01",
            "comment": "",
            "category": {
                "id": "2188461"
            },
            "owner": {
                "id": "23788456"
            },
            "document_type": "application/pdf",
            "size": 3908,
            "created_at": "2024-07-02 08:50:35",
            "virus_scan": {
                "status": "safe"
            },
            "esignature": {
                "status": "status_unspecified"
            }
        }
    ],
    "_meta": {
        "links": {
            "self": {
                "href": "https://api.personio.de/v2/document-management/documents?cursor=eyJvd25lcklkIjoyMzc4ODQ1NiwiY2F0ZWdvcnlJZCI6bnVsbCwibGltaXQiOm51bGwsImNyZWF0ZWRBdEd0ZSI6bnVsbCwiY3JlYXRlZEF0THQiOm51bGwsImN1cnNvciI6bnVsbH0="
            }
        }
    }
}

 

Thanks for your follow-up and let me know in case you have further questions. 😀

Best,

Steve

Your reply