Search Jobs

Prev Next

This tutorial demonstrates how to search for jobs via the RESTful API.

The steps include:

  • Searching for a job using the job name

The commands are provided in curl and can be run from the command prompt when the Synergy Server is running (or in a batch script)

Additional API documentation

To get a list of most of the API requests available, with the 12d Synergy server running, browse http://synergy.myserver.com/api-docs/ui/index.

(Replace synergy.myserver.com with the external server address and update the port numbers if necessary.)

1.1. Getting the Personal Access Token to access API

The tutorial for getting the PAT is here: Generate PAT in Web client.

1.2. Search for a job using the job name

This request can be found in the API documentation under Jobs marked 'Job search'.

Below is a sample for searching jobs with the name “user“.

Parameters

  • QuickSearchTerm — Using this field, it matches the prefix of the string that a user inputs.

  • Name — Using this field, it matches any part of the string regardless of the position.

  • Page — Using this field, it specifies the page number of results to return when performing pagination.

  • PageSize — Using this field, it defines the number of results per page to be returned.

Attributes (optional) — If you analyze this field, it has a filter to restrict jobs to the top level. It is set to false in the Value field.

Click in the line below to see the code.

Sample Request

curl --location 'http://synergy.myserver.com/api/v1/jobs/search' \
--header 'Authorization: Bearer <your-token-here>' \
--header 'Content-Type: application/json' \
--data '{
    "QuickSearchTerm": "",
    "Name": "user",
    "Page": 1,
    "PageSize": 10,
    "Attributes": [
        {
	        "Attribute": {
	            "Name": "TopLevel",
	            "DisplayName": "Restrict to top level?"
	        },
	        "Type": "SynergyServerWeb.API.Models.SelectableProgrammaticAttribute",
	        "Value": false,
	        "SearchQueryType": 4,
	        "Operation": 0,
	        "Name": "Restrict to top level?",
	        "OperationName": "="
	    }
    ]
}'

Below is a sample response for a job with the name “user”. Click in the line below to see the code.

Sample Response

{

    "PageNumber": 1,

    "PageSize": 10,

    "TotalRows": 1,

    "TotalPages": 1,

    "Result": [

        {

            "ID": {

                "_id": 2,

                "_server_id": 1,

                "_server_guid": "b993c729-bf98-490c-989d-5621e3b48139",

                "IDString": "2_1"

            },

            "Name": "Test User",

            "Description": "Personal job for Test User",

            "JobCreatorName": "Test User",

            "CreatedDate": "2025-03-20T01:57:18.137",

            "NoOfChildren": 0,

            "NoOfFolders": 4,

            "NoOfTDJobs": 0,

            "InheritPermissions": true,

            "InheritFileNamingRules": false,

            "AlwaysDisplayParent": false,

            "DeleteLocked": false,

            "Type": "Normal",

            "CreatorID": {

                "_id": 10002,

                "_server_id": 1,

                "_server_guid": "b993c729-bf98-490c-989d-5621e3b48139",

                "IDString": "10002_1"

            },

            "ParentJobID": null,

            "Attributes": [],

            "JobItems": null,

            "NoOfNotes": 0,

            "Path": "Test User",

            "EntityObject": {

                "parent_project_id": null,

                "creator_name": "Test User",

                "num_children": 0,

                "num_folders": 4,

                "num_td_projects": 0,

                "inherit_permissions": true,

                "always_display_parent": false,

                "rule_set": null,

                "inherits_file_naming_rules": false,

                "delete_locked": false,

                "cad_publish_output_path": null,

                "customisation_info": null,

                "id": {

                    "_id": 2,

                    "_server_id": 1,

                    "_server_guid": "b993c729-bf98-490c-989d-5621e3b48139",

                    "IDString": "2_1"

                },

                "name": "Test User",

                "create_date": "2025-03-20T01:57:18.137",

                "creator_id": {

                    "_id": 10002,

                    "_server_id": 1,

                    "_server_guid": "b993c729-bf98-490c-989d-5621e3b48139",

                    "IDString": "10002_1"

                },

                "attributes": [],

                "description": "Personal job for Test User",

                "type": 0

            }

        }

    ]

}