Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

To successfully run tasks on ARES CLI through API, you will require the following:

  1. Generate API Token
    Login
    Access the Tokens tab after logging in to https://arescli.graebert.com/ platform and access Tokens tab.
    Click . If this is your initial login to Graebert’s portal, you might have to register and revisit the https://arescli.graebert.com/ page post email verification. Proceed by clicking on 'Generate new API key,' then copy and use apply it on to the designated API endpoints.

    image-20240530-170629.pngImage Modified

  1. Load Environment
    Use Utilize the POST method on /{type}/upload, with specifying type = environment to load upload the .zip file. Get Retrieve the response environment ID to use on for utilization in job execution. Upon successful loading of this environment, reloading is unnecessary unless customization is needed.

    View file
    namebim2pdf.zip

    API Referece

    image-20240530-171035.png
  2. Load File
    Use Utilize the POST endpoint /{type}/upload, with where type = file, to load upload the file that needs to be processed (either .rvt file or .ifc).
    Get Obtain the response file ID to for use on during job execution. Remember, each time you have a new file that needs processing, it must be uploaded before executing the job.

    image-20240530-171212.png

  3. Execute Job

Use Utilize the POST /execute method to create establish and run execute a new jobfresh task.
FillComplete the following fields: “environment:“ with

  • Set "environment:" to the corresponding environment ID.

”configuration
  • Assign "configuration:

” with configuaration content (see
  • " with the configuration string (refer to the details displayed in the right panel).

    View file
    nameconfig string sample.json

“files:“ with file ID
  • Specify "files:" as per file ID.


Within the configuration string, ensure that you substitute BIM_Input variable's value with the specific name of the file intended for processing (the uploaded file dispatched via files for execution endpoint).


image-20240530-171720.png
Code Block
{
    "Inputs": {
        "comment": "the input file format as uploaded on the ARESCLI portal Environment NOTE: should be same of script var BIM_input in the script section for this script",
        "inputfileformat": "rvt",
        "script": {
            "comment": "location and extension of the script as uploaded on the ARESCLI portal Environment. Also the variables used the script are defined in this section",
            "scriptpath": "scripts/bim2pdf.scr",
            "scriptformat": "scr",
            "scriptvariables": [{
                "name": "OUTPUTDIR",
                "value": "output.dwg",
                "comment":"name of the desired output file, NOTE: this name should be same as the first name of the outputfilename(extension should be dwg) in Outputs section"
            },
            {
                "name": "BIM_input",
                "value": "input.rvt",
                "comment":"name of the rvt file as uploaded on the ARESCLI portal, NOTE:this is not the fileId" 
            },
            {
                "name": "BIM_AUTO_TEMPLATE",
                "value": "templates/bimautotemplates/ISO_A1_Landscape(1_100)_Header_wfields.dwg",
                "comment":"location of the bim templates in zip uploaded on the ARESCLI portal Environment"

            }]
        },
        "templates": {
            "comment": "location of the templates in zip and their extensions as uploaded on the ARESCLI portal Environment",
            "drawingtemplate": "templates/drawingtemplates/standardiso_mm.dwt",
            "drawingtemplateformat": "dwt",
            "bimautotemplates": "templates/bimautotemplates/ISO_A1_Landscape(1_100)_Header_wfields.dwg", 
            "bimautotemplatesformat": "dwg"
        }
    },
    "Outputs": {
        "outputfileformat": "pdf",
        "outputfilename": "output.pdf",
        "comment": "name of the desired output file NOTE: the name of file without the extension should be same as the script var OUTPUTDIR for this bim2pdf script"
    }
}

  1. Track Job status
    Use Utilize the endpoint GET/jobs/{jobId}/download/{type}/{jobid} to track monitor the status progress of the job. -

    • PENDING

    -
    • COMPLETE

    -
    • FAILURE

  2. Download job result
    Use Utilize the GET /jobs/{jobId}/download/{type} with endpoint by specifying type = result to download retrieve the output file.
    In case If the job failed, download encountered an issue, access files with type = log and type = zip to get analyze the files to investigate the error further.