Documentation

Post An Experiment

Post an Experiment from the Message Body of a Request

To post an experiment via the request message body, you will need to send an HTTP POST request to the base experiments service url (with the desired user specified). For example, if we use the Lifemapper public anonymous user as the owner of this new experiment, the resulting url is:

/services/sdm/experiments/xml

Next, we will build the request message body. This is the content that should be posted to the service. We will use the following parameters:

You can see an example request at:

/samples/sampleExperimentRequest.xmlM

Our example results in a request looking like this:

If you send an HTTP POST to our url with this as the request body, the response will be something like:

The HTTP response code should be 202. If it is 400 check your request. If it is anything else, contact us at: lifemapper [at] ku [dot] edu for help.

When you read the response, note that the element in: lm:response/lm:urls/lm:url will contain a url pointing to your new experiment. Keep note of the experiment id which is the number listed at the end of the url. In this case, the experiment id is 282.

Post an Experiment from URL parameters

To post an experiment via URL parameters, you just need to determine what the url should be and send an HTTP POST request to it. The url for posting an experiment only accepts id's for the parts of the experiment: occurrence set, algorithm, environmental set and environmental projection layers.

Use the form below to create an example URL

Example URL

For this example, we will use occurrence set 3345122, algorithm Bioclim, scenario 32 for the model, and scenarios 32, 33, and 35 for projections. We will also use the public anonymous user for the owner of this experiment.

The resulting url is:

/services/sdm/experiments/xml?algorithmCode=Bioclim&occurrenceSetId=3345122&modelScenario=32&projectionScenario=32&projectionScenario=33&projectionScenario=35

If you send an HTTP POST to that url, the response will be something like:

The HTTP response code should be 202. If it is 400 check your request. If it is anything else, contact us at: lifemapper [at] ku [dot] edu for help.

When you read the response, note that the element in: lm:response/lm:urls/lm:url will contain a url pointing to your new experiment. Keep note of the experiment id which is the number listed at the end of the url. In this case, the experiment id is 215.