Translate

The translate element has to components:

  • translate resource - handles the multilanguage interface translations, but the key-value principle
  • translate template - manages the screen and email messages and text generation. Works with the replaceable tags principle.

Method: get resource

Authorization is required.

Request

HTTP request

GET https://<YOUR_DOMAIN>/api/v1/en_US/translate/resource/{key}/group/{groupId}

Parameters

property value description
key string The translate resource replaced key
groupId guid The group for which you need the resource. Resources can be overrided on group level.

Request body

Do not supply a request body with this method.

Response

If successful, this method returns a response JSON with the following structure:

{
	"timestamp": "2014-03-03T23:20:23Z",    
	"success": true,
	"message": "Aliqua anim consequat amet cupidatat proident amet amet.",
	"errors": [],
	"object": {
		"id": 1,
		"type": "translateResource",
		"key": "err_file_extension",
		"value": "Invalid Extension",
		"description": ""
	}
}

The general response properties are described on the Response format page. Here are the list of the specific properties for this method.

property value description
id integer The resource Id
key string The value that will be looked and replaced during page generation
value string What to replace the key with
description string some description about the resource if there is any

Method: list resource

Authorization is required.

Request

HTTP request

GET https://<YOUR_DOMAIN>/api/v1/en_US/translate/resource/list/group/{groupId}?offset={offset}&pageSize={pageSize}&filter={filter}

Parameters

property value description
groupId guid The elements group's ID
offset integer Needed for the infinite scroll functionality. It is the ID of the last presented item to the user. After the request list is generated the system will skip all records from the beginning up to the record with the provided ID (including it). The next batch of records will be returned in the response.
pageSize integer How many records to be returned by the system. Usually 15
filter string Query string to be looked for when filtering the records

Request body

Do not supply a request body with this method.

Response

If successful, this method returns a response JSON with the following structure:

{
  "timestamp": "2014-03-03T23:20:23Z",
  "success": true,
  "message": "Occaecat duis ad incididunt aute veniam ad nisi deserunt Lorem officia.",
  "errors": [],
  "object": {
    "offset": 10,
    "resources": [
      {
        "id": 1,
        "type": "translateResource",
        "key": "err_file_extension",
        "value": "Invalid Extension",
        "description": ""
      }
    ]
  }
}

The general response properties are described on the Response format page. Here are the list of the specific properties for this method.

Method: update resource

Authorization is required.

Request

HTTP request

PUT https://<YOUR_DOMAIN>/api/v1/en_US/translate/resource/{key}/group/{group}

Parameters

property value description
key string The translate resource replaced key
groupId guid The group for which you need the resource. Resources can be overrided on group level.

Request body

property value description
value string the text that needs to replace the key in the selected group

Response

If successful, this method returns a response JSON with the following structure:

{
	"timestamp": "2014-03-03T23:20:23Z",	
	"success": true,
	"message": "Aliqua anim consequat amet cupidatat proident amet amet.",
	"errors":[
		{
		"key":"value",
		"value":"",
		"message": "Value cannot be blank"
		}],
	"object": {
		"id": 1,
		"type": "translateResource",
		"key": "err_file_extension",
		"value": "Invalid Extension 11",
		"description": ""
	}
}

The general response properties are described on the Response format page. Here are the list of the specific properties for this method.

property value description
success Boolean Whether the requested operation is successful or not
message String Human readable error information
errors List (object) List of validation errors, if any. The "key" property value is matched to one of the record's fields
object object The object that caused the validation errors or the updated object. Have in mind that, if the server requires string trimming or data manipulation after the user submission, it is applied in this object. In this way the returned object can differe from the posted one.

Method: get template

Authorization is required. Root group administrator privileges required.

Request

HTTP request

GET https://<YOUR_DOMAIN>/api/v1/en_US/translate/template/{key}

Parameters

property value description
key string The template's string ID

Request body

Do not supply a request body with this method.

Response

If successful, this method returns a response JSON with the following structure:

{
	"timestamp": "2014-03-03T23:20:23Z",    
	"success": true,
	"message": "Aliqua anim consequat amet cupidatat proident amet amet.",
	"errors": [],
	"object": {
		"id": 9,
		"type": "translateTemplate",
		"key": "invitation_mail_header",
		"templateType": "Screen message",
		"title": "Invitation mail header",
		"description": "Header of invitation email",
		"subject": "Some subject here",
		"content": "Excepteur sint obcaecat cupiditat non proident",
		"tags":[]
	}
}

The general response properties are described on the Response format page. Here are the list of the specific properties for this method.

property value description
id integer the id of the template. For template identification HiveSocial uses the "key" property
key string String that is used for identifying the template
templateType string Whether the template is a screen message or an email message
title string the templates title, used for identifying the template in the templates list
description string some explanation about the template
subject string If the template is an email message, this will be used as an email subject
content string the actual text that is presented to the user or send as email body

Method: list template

Authorization is required. Root group administrator privileges required.

Request

HTTP request

GET https://<YOUR_DOMAIN>/api/v1/en_US/translate/template/list

Parameters

Do not supply a request parameters with this method.

Request body

Do not supply a request body with this method.

Response

If successful, this method returns a response JSON with the following structure:

{
	"timestamp": "2014-03-03T23:20:23Z",
	"success": true,
	"message": "Occaecat duis ad incididunt aute veniam ad nisi deserunt Lorem officia.",
	"errors": [],
	"object": {
		"offset": 10,
		"templates": [
			{
				"id": 1,
				"type": "translateTemplate",
				"key": "confirmation_email",
				"templateType": "Email",
				"title": "Confirmation Email",
				"description": "The message which is sent after a new user activates his account. Contains information about its username, the password is masked.",
				"subject": "Welcome to HiveSocial - Account Details",
				"content": "Some text and a login_link",
				"tags":[
					{
						"id": 2,
						"key": "login_link",
						"description": "login link"
					}
				]
			}
		]
	}
}

The general response properties are described on the Response format page. Here are the list of the specific properties for this method.

Method: update template

Authorization is required. Root group administrator's privileges required

Request

HTTP request

PUT https://<YOUR_DOMAIN>/api/v1/en_US/translate/template/{key}

Parameters

property value description
key string The template identification string

Request body

property value description
subject string The template subject
content string The template content

Response

If successful, this method returns a response JSON with the following structure:

{
	"timestamp": "2014-03-03T23:20:23Z",	
	"success": true,
	"message": "Aliqua anim consequat amet cupidatat proident amet amet.",
	"errors":[
		{
		"key":"subject",
		"value":"",
		"message": "Subject cannot be blank"
		}],
	"object": {
		"id": 1,
		"type": "translateTemplate",
		"key": "confirmation_email",
		"templateType": "Email",
		"title": "Confirmation Email",
		"description": "The message which is sent after a new user activates his account. Contains information about its username, the password is masked.",
		"subject": "Welcome to HiveSocial - Account Details 11",
		"content": "Some text with a login_link",
		"tags":[
			{
				"id": 2,
				"key": "login_link",
				"description": "login link"
			}
		]
	}
}

The general response properties are described on the Response format page. Here are the list of the specific properties for this method.