Skip to main content

Format Conversion (Self Integration)

For some special scenarios, such as data security requirements, network policies, etc., HAP also provides a way for self integration. Developers can refer to WPS's Convert to PDF and Format Conversion Result Query API documentation to independently implement these two APIs (the request method, request headers, request body, and response body format must be fully consistent). The underlying technology used can be completely customized.

Tips:

For the header parameters in the interface, if it is in an intranet environment, consider ignoring authentication logic.

Please ensure that the servers deploying microservices have normal connectivity with ENV_WPS_HOST.

After completing interface development, you need to add the following 5 environment variables in the configuration file of the HAP microservice:

ENV_WPS_HOST: "Host address, default to https://solution.wps.cn"
ENV_WPS_CONVERT_PDF_API_PATH: "Request path for converting documents to pdf, default to /api/developer/v1/office/convert/to/pdf"
ENV_WPS_CONVERT_TASK_API_PATH: "Request path for querying format conversion results, default to /api/developer/v1/tasks/:task_id"
ENV_WPS_CONVERT_APPID: "Any string"
ENV_WPS_CONVERT_APPSECRET: "Any string"

Finally, restart the HAP microservice.