POST V1 ems/studies
Adds a Study to a Project.
Request Information
Parameters
Name | Description | Additional information |
---|---|---|
study |
Object describing the study to add to the project:
|
Define this parameter in the request body. |
Example Request
To add a Study with the name "Study Name", objectives "Study Objectives" and rating "BRONZE" to the project 1234, make the following API call:
POST /ems/studies
and put the following content in the request body:
ProjectId=1234&Name=Study Name&StudyObjectives=Study Objectives&StudyRating=Bronze
Request body formats
application/json, text/json
Sample:
{ "ProjectId": 12345, "Name": "Study Name", "StudyObjectives": "Objectives", "StudyRating": "GOLD" }
application/xml, text/xml
Sample:
<Study xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Unilever.Urdps.Hts.EmsApi.EntityRepresentations.Request.V1"> <Name>Study Name</Name> <ProjectId>12345</ProjectId> <StudyObjectives>Objectives</StudyObjectives> <StudyRating>GOLD</StudyRating> </Study>
application/x-www-form-urlencoded
Sample:
ProjectId=12345&Name=Study Name&StudyObjectives=Objectives&StudyRating=GOLD
Request Detail
This request should be made with the Content-Type header set to 'application/x-www-form-urlencoded', 'application/json' or 'application/xml'.
This endpoint requires the api-username
and
api-usertoken
headers to be present. If these headers are not present, a 401 (Unauthorized)
response will be returned.
Response Information
HTTP Status Codes
Status Code | Meaning |
---|---|
201 (Created) | The request has completed successfully. The ID of the new study will be contained in the response. |
400 (Bad Request) | The data in the request body was invalid OR A value for ProjectID, StudyName, StudyObjectives and StudyRating must be provided OR there is no project with the given ID OR the supplied study name already exists within this project OR the study name is too long or includes invalid characters OR the study objective is too long or contains invalid characters OR the study rating must be BRONZE, SILVER or GOLD The nature of the error will be indicated in the Response content. |
401 (Unauthorized) | The user has not been authorised due to the below reasons which will be displayed in the
response
content.
API Key is not found. Data received apiKey
Secret Key is wrong. Data received apiKey
Username not found. Data received apiKey
Received token not found in EMS issuer. Data received username ,
version
Lifetime validation failed. The token is expired. ValidTo (UTC):
expiry , Current time
(UTC): UTC DateTime
Token creation failed. Reason: The given username or password is wrong. For input:
username , version
Please ensure that the client provides the api-username and
api-usertoken headers.
|
403 (Forbidden) | The user does not have write access to the specified project. |
503 (ServiceUnavailable) | EMS is currently unavailable. Please try again later or contact a system administrator to ask when EMS will be back online. |