Manuais
PHC GO Fetch Document
 

Method


The method to be called is:



Parameters


In the request headers the Authorization header must have the Access Token:

  • Authorization: {{accessToken}}


JSON body


In the body of the POST a JSON structure like this one has to be passed:

{
"requestOptions": {
"reportName": "Impressão Minimal Simples",
"requestedFields": [
"ftstamp",
"etotal",
"ettiva"
]
},

"document": {
"docType": 1,
"documentNumber": 285
}
}

 

Return Information


Any call made to this method will return a JSON information with this structure:

  1. In case of success:


    {
    "code": 0,
    "message": "Document no: 285 was found.",
    "pdf": "LINK FOR THE DOCUMENT PDF"
    }


  2. In case of error:


    {
    "code": 100,
    "message": "Error message"
    }


 

JSON Specification for Fetch Document



Request Options


 
NameTypePHC GO EntityPHC GO FieldObservations
reportNameStringName of the report type the document should have. If not defined will use one of the reports the user has access to Ex. “Impressão Minimal Simples”.
viaDocIntegerOptions of document’s via to print the document:
0 – All
1 – Original
2 – Second way
3 – Duplicate
4 – Triplicate
5 – Quadruplicated
6 – Quintupled
7 – Following
Case this field is not defined it will be used the value 0 as default
requestedFieldsString ArrayThe PHC Go document entity fields to be returned on Success

 

Document


 
NameTypePHC GO EntityPHC GO FieldObservations
docType1IntegerTdndocType of document to create
documentNumber1StringFtfno
documentYearIntegerFtftanoSpecifies the year of document year

 


Footnotes


1 - Required

 
 

Example