Description

CURL Commands can be used to do the following in the REST API: 


Login API

CURL COMMAND BELOW:


curl -X POST -H "Content-Type: application/json" -d '{"username": " Provide username here ","password": " Provide password here "}' https://app.genrocket.com/rest/login

CURL to get the list of Scenario Chains

CURL COMMAND BELOW:


curl -X POST " https://app.genrocket.com/rest/chain/list " -H "accept: application/json" -H "x-auth-token: Access token received from Rest Login API " -H "Content-Type: application/json" -d '{"organizationId":" Organization external id ","projectName": " Project Name here ","versionNumber":" Project Version Here "}'


----Response of above CURL


{
"chains": [
     {
         "name": "Parquet1ScenarioChain",
         "description": null,
         "externalId": "sample-external-id",
         "scenarios": [
             {
                "name": "GrRootScenario"
              },
              {
                 "name": "MergeScenario"
              }
           ]
       }
   ]
}



CURL to Download Scenario Chain

CURL COMMAND BELOW:


curl -X POST " https://app.genrocket.com/rest/chain/download " -H "accept: application/json" -H "x-auth-token: Access token received from Rest Login API " -H "Content-Type: application/json" -d '{"chainId": " ExternalId from previous Scenario Chain List API response "}' --output " provide name from previous response and ends with .grs "


Note: Output name will be named from the previous response and append .grs at the end of the name like Parquet1ScenarioChain.grs.


CURL to get the list of Scenario Chain Set

CURL COMMAND BELOW:


curl -X POST " https://app.genrocket.com/rest/chainSet/list " -H "accept: application/json" -H "x-auth-token: Access token received from Rest Login API " -H "Content-Type: application/json" -d '{"organizationId":" Organization external id ","projectName": " project name here ","versionNumber":" Project version here "}'


CURL to Download Scenario Chain Sets

CURL COMMAND BELOW:


curl -X POST " https://app.genrocket.com/rest/chainSet/download " -H "accept: application/json" -H "x-auth-token: Access token received from Rest Login API " -H "Content-Type: application/json" -d '{"chainSetId":" provide external id from Scenario Chain Set List api response "}' --output " provide name from previous response and ends with .grs "


Note: Output name will be named from the previous response and append .grs at the end of the name like Avro1ScenarioChainSet.grs.


CURL to Download Offline Certificate

CURL COMMAND BELOW:


dateTime=`date '+%d-%m-%Y-%H-%M'` && curl -k -X POST
"https://app.genrocket.com /rest/offlineCertificate/download" -H "accept: application/json" -H "x-auth-token: Access token received from Rest Login API" -H "Content-Type: application/json" -d
"{\"organizationId\":\" Organization external id \",\"dateTime\":
\"${dateTime}\"}" --output "GRXXXXXXXCertificate.grc"


Note: GRXXXXXXX detail we can get from ProfileId in MyOrganization and Certificate.grc at end like GR1234567Certificate.grc and that will same for all member of your organization and no need to edit dateTime parameter in JSON request,


CURL to get the list of Configuration Files

CURL COMMAND BELOW:


curl -X POST " https://app.genrocket.com/rest/configuration/list " -H "accept: application/json" -H "x-auth-token: Access token received from Rest Login API" -H "Content-Type: application/json" -d '{"organizationId":" Organization external id ","projectName": " project name here ","versionNumber":" project version here "}'


----response sample


{
   "configs":
      [
         {
            "name": "AvroConfig",
            "fileName": "AvroConfig.xml",
            "configType": "AVRO",
            "requestURL": null
         },
         {
            "name": "Config",
            "fileName": "Config.xml",
            "configType": "JSON",
            "requestURL": null
         },
         {
            "name": "JSONConfig",
            "fileName": "JSONConfig.xml",
            "configType": "JSON",
            "requestURL": null
          }
      ]
  }


CURL to Download Offline Certificate for GMUS

CURL COMMAND BELOW:


curl -X POST "https://app.genrocket.com/rest/offlineCertificate/gmus/download" -H "accept: application/json" -H "x-auth-token:<TokenReceiverFromLoginRquest>" -H "Content-Type: application/json" -d "{'applicationId': '<applicationId>'}" --output "<profileId>GMUSCertificate.grc"



Note: GRXXXXXXX detail we can get from ProfileId in My Organization and Certificate.grc at the end like GR1234567GMUSCertificate.grc and that will same for all members of your organization.


CURL to Download Configuration File

CURL COMMAND BELOW:


curl -X POST " https://app.genrocket.com/rest/configuration/download " -H "accept: application/json" -H "x-auth-token: Access token received from Rest Login API " -H "Content-Type: application/json" -d '{"organizationId":" Organization external id ","projectName": " Project name here ","versionNumber":" Project version here ", "configName": " Provide name from previous Configuration List API response "}' --output " provide file name from previous API response "