Versions Compared

Key

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

For email configuration in OpenSpecimen via UI, go to the settings → email 

Image Removed

 Image Added


Below are the REST APIs for configuring email module settings:

...

Use this resource to configure email settings in the OpenSpecimen application. Use HTTP PUT method to call this API by passing the below details in JSON format:

 


Parameter Details :

The user authentication API takes the following parameters in json request :

...


http[s]:<host>:<port>/openspecimen/rest/ng/config-settings

Use this URL to configure/update the properties


Result:

The response of this request will contains the details of the added/updated property.

Below is the example of the register authentication domain:

  1.  Sets email server host
URL/openspecimen/rest/ng/config-settings
MethodPUT
Requestapplication/json
json
{
  "module": "email",
  "name": "server_host",
  "value": "localhost"
}

Response

{
  "module": "email",
  "name": "server_host",
  "value": "localhost"
}

 


      2.  Sets email server port

URL/openspecimen/rest/ng/config-settings
MethodPUT
Requestapplication/json
json
{
  "module": "email",
  "name": "server_port",
  "value": "25"
}

Response

{
  "module": "email",
  "name": "server_port",
  "value": "25"
}

 


3.  Sets email account id
URL/openspecimen/rest/ng/config-settings
MethodPUT
Requestapplication/json
json
{
 "module": "email",
  "name": "account_id",
  "value": "test@gmail.com"
}

Response

{
 "module": "email",
  "name": "account_id",
  "value": "test@gmail.com"
}
 


4.  Sets email account id
URL/openspecimen/rest/ng/config-settings
MethodPUT
Requestapplication/json
json
{
 "module": "email",
  "name": "account_password",
  "value": "password"
}

Response

{
 "module": "email",
  "name": "account_password",
  "value": "password"
}
 


5.  Set mail.smtp.starttls.enable
URL/openspecimen/rest/ng/config-settings
MethodPUT
Requestapplication/json
json
{
 "module": "email",
  "name": "starttls_enabled",
  "value": "true"
}

Response

{
 "module": "email",
  "name": "starttls_enabled",
  "value": "true"
}
 


6.  Set mail.smtp.auth
URL/openspecimen/rest/ng/config-settings
MethodPUT
Requestapplication/json
json
{
 "module": "email",
  "name": "auth_enabled",
  "value": "true"
}

Response

{
 "module": "email",
  "name": "auth_enabled",
  "value": "true"
}

7. Set admin email id

URL/openspecimen/rest/ng/config-settings
MethodPUT
Requestapplication/json
json
{
 "module": "email",
  "name": "admin_email_id",
  "value": "admin@admin.com"
}

Response

{
"module": "email",
"name": "admin_email_id",
"value": "admin@admin.com",
}

8.  Sets application url (this belongs to common module)
URL/openspecimen/rest/ng/config-settings
MethodPUT
Requestapplication/json
json
{
 "module": "common",
  "name": "app_url",
  "value": "http://localhost:9000"
}

Response

{
 "module": "common",
  "name": "app_url",
  "value": "http://localhost:9000"
}

 



Error cases :

This section describes the response cases for register authentication API

code
Applies to
Status Message
200All resourcesDomain has been registered successfully
400All requestsInvalid parameters, e.g  blank implClass in-case of custom domain, duplicate domain name etc
401All requestsAuthorization failed, user doesn’t have authority
500All requestsInternal server error, encountered server error while performing operations or provided wrong ldap information

 

...