Add new doc

This interface is used to add a new doc to a worker.

Add user's docs

POST /add-ee-docs

<Description of the endpoint>

Headers

Name
Value

Content-Type

application/json

Authorization

Bearer <token>

Body

Name
Type
Required
Description

email

string

Account email of the user

customer_id

number

The unique Marco identifier for your company

file

file resource

File resources can accept multiple inputs. The most common is a standard upload through a web form. However, you can also use a publically accessible URL and Marco can download the resource on the fly or you can use a data URI format.

Parameter Example

{
  "customer_id": "1",
  "email": "[email protected]",
  "file": 
}

Request Example

var form = new FormData();
form.append("customer_id", "1");
form.append("email", "[email protected]");
form.append("file", fileInput.files[0], "/C:/Users/ZhounanZhang/OneDrive - Marco Global Payroll Pte Ltd/Desktop/New Microsoft Word Document.docx");

var token = YOUR_TOKEN
var settings = {
  "url": "https://api.marcopayroll.com/api:eZ5RDmx2/api/add-ee-doc",
  "method": "POST",
  "timeout": 0,
  "headers": {
    "Authorization": token 
  },
  "processData": false,
  "mimeType": "multipart/form-data",
  "contentType": false,
  "data": form
};

$.ajax(settings).done(function (response) {
  console.log(response);
});

Response

{
    "id": 19282,
    "file_name": "New Microsoft Word Document.docx",
    "file_type": "docx",
    "file_url": "https://marcopayroll-production.s3.ap-southeast-1.amazonaws.com/doc/4c572b3d-6b02-4678-91f9-0eea783c7a39-1727168194081.docx?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAR7OVYMK3MWXZDBXJ%2F20240924%2Fap-southeast-1%2Fs3%2Faws4_request&X-Amz-Date=20240924T085634Z&X-Amz-SignedHeaders=host&X-Amz-Expires=600&X-Amz-Signature=6edcde0cbc946fe85260b87149c8bb021fe2e4f95f346706acedfdae4fbe6714"
}

Last updated