Terms APIs
Click an API to expand/collapse it.
- Description
- Return terms and conditions as text.
- Request Endpoint
- GET https://<Example api server address>common/fetch/terms/{countryCode}/{language}
- Parameters
-
None.
- cURL Syntax
-
curl --include \
'https://core.dev.Example.net/api/common/fetch/terms/countryCode/language'
- Parameters
-
Parameter |
Type |
Use |
Description |
countryCode |
String |
Required |
A country code. |
language |
String |
Required |
A human language native to a country. |
- Response body
-
Headers: Content-Type: application/json | HTTPS Status Code: 200
{
"data": {
"id": "362ff701-df13-476c-8bec-8bb46527de8f",
"updatedBy": "",
"countryCode": "IN",
"language": "HI",
"terms": "<!DOCTYPE html><html ..."
},
"detail": null,
"error" false,
"message": "Terms and conditions are fetched successfully"
}
Return to top
- Description
-
(Only for Admin) This service will upload a HTML file as multipart form data and stores the content of the file as a string in the database against countryCode and language. The countryCode and language combination is unique, hence, if the service is called again, it will extract HTML content and update the terms text content only.
- terms (required, multipart) - browse HTML file with header Accept-Encoding : multipart/form-data
- Request Endpoint
- POST https://<Example api server address>/common/upload/terms/countryCode/language
- Parameters
-
None.
- cURL Syntax
-
curl --include \
--request POST \
'https://core.dev.Example.net/api/common/upload/terms/countryCode/language'
- POST Attributes (JSON)
-
Attribute |
Type |
Use |
Description |
countryCode |
String |
Required |
A country code. |
language |
String |
Required |
A human language native to a country. |
- Response body
-
Headers: Content-Type: application/json | HTTPS Status Code: 200
{
"data": true,
"detail": null,
"error": false,
"message": "Terms and conditions are saved successfully"
}
Return to top
- Description
- (Only for Admin) This service will return all terms and condition as text.
- Request Endpoint
- GET https://<Example api server address>/common/fetch/all/terms
- Parameters
-
None.
- cURL Syntax
-
curl --include \
'https://core.dev.Example.net/api/common/fetch/all/terms'
- Response body
-
Headers: Content-Type: application/json | HTTPS Status Code: 200
{
"data": [
{
"id": "362ff701-df13-476c-8bec-8bb46527de8f",
"updatedBy": "",
"countryCode": "IN",
"language": "HI",
"terms": "<!DOCTYPE html><html ..."
},
],
"detail": null,
"error": false,
"message": "All Terms and conditions are fetched successfully"
}
Return to top