This module adds the abliity to manage SmartDocs using APIs.
This is an open-source project from Apigee. It is not covered by Apigee support contracts. However, we will support you as best we can. For help, please open an issue in this GitHub project or on community.apigee.com. You are also always welcome to submit a pull request.
The module exposes a new role "smartdocs service role," which has the ability to call these portal-APIs. Those portal-APIs depend on management APIs that are not yet published as they are not considered stable enough due to planned changes to document/support externally at this time.
It is recommended that customers create a new service account and assign this role. This restricts access to what the service account can do.
Prerequisite: download the module dependencies and place them in the sites/all/modules/contrib
folder.
Enabling this module will expose an API endpoint on http://portal.loc/smartdocs/apis/model
cURL commands for the operations enabled by this module: Note: Use HTTP Basic Auth for these APIs (Username/password is the credential for the service account setup on DevPortal)
curl -X GET -H "Authorization: Basic BASE64_ENCODED_USERNAME_PASSWORD" -H "Accept: application/json" http://portal.loc/smartdocs/apis/models
curl -X POST -H "Authorization: Basic BASE64_ENCODED_USERNAME_PASSWORD" -H "Content-Type: multipart/form-data;" -F "description=First 5 characters of the alphabet" -F "name=abcdE" -F "display_name=ABCDE" "http://portal.loc/smartdocs/apis/models"
curl -X GET -H "Authorization: Basic BASE64_ENCODED_USERNAME_PASSWORD" "http://portal.loc/smartdocs/apis/models/abcdE"
curl -X DELETE -H "Authorization: Basic BASE64_ENCODED_USERNAME_PASSWORD" "http://portal.loc/smartdocs/apis/models/abcdE"
curl -X POST -H "Authorization: Basic BASE64_ENCODED_USERNAME_PASSWORD" -H "Content-Type: multipart/form-data;" -F "[email protected]" "http://portal.loc/smartdocs/apis/models/abcdE/import"
This is a two step process:
Add the items to be rendered to a queue:
curl -X POST -H "Authorization: Basic BASE64_ENCODED_USERNAME_PASSWORD" "http://portal.loc/smartdocs/apis/models/abcdE/render"
(This is done by either calling the cron job directly by a CURL request or using drush cron command) If you login into the portal you will get a cron url with token (Configuration > System > Cron) You may need to run that URL multiple times to process all items (only 30 items are processed at a time)
You can also run drush queue-run smartdocs_service_queue
command on the portal server to process these items.
curl -X POST -H "Authorization: Basic BASE64_ENCODED_USERNAME_PASSWORD" "http://portal.loc/smartdocs/apis/models/queue_status"