---
# System prepended metadata

title: API Contract - Translation

---

API Contract - Translation
===
[[BE][CMS] Translation](https://trello.com/c/OGmH15CJ)
### Get Translations
__Host__ 
https://apidev.forky.id/cms/translation

__Request__
```json
Authorization: Bearer [TOKEN]

GET v1/translations
```

__Response__ **200**
```json
{
    "message": "Success",
    "translations": [
        {
            "code": "ID",
            "language": "Bahasa Indonesia",
            "groups": [
                {
                    "id": "jR",
                    "name":"Auth",
                    "data": [
                        { "id": "jR", "key": "Auth", "value": "Masuk" },
                        { "id": "k5", "key": "Login", "value": "asdf" }
                    ],
                },
                {
                    "id": "l5",
                    "name":"Error",
                    "data":[
                        { "id": "l5", "key": "Auth", "value": "asdf" },
                        { "id": "BX", "key": "Login", "value": "asdf" }
                    ]
                }
            ]
        },
        {
            "code": "ENG",
            "language": "English",
            "groups": [
                {
                    "id": "k5",
                    "name":"Auth",
                    "data": [
                        { "id": "encrypted_id", "key": "Auth", "value": "Masuk" },
                        { "id": "encrypted_id", "key": "Login", "value": "asdf" }
                    ],
                },
                {
                    "id": "BX",
                    "name":"Error",
                    "data":[
                        { "id": "encrypted_id", "key": "Auth", "value": "asdf" },
                        { "id": "encrypted_id", "key": "Login", "value": "asdf" }
                    ]
                }
            ]
        }
    ]
}
```
---
### Create a New Group
__Host__ 
https://apidev.forky.id/cms/translation

__Request__
```json
Authorization: Bearer [TOKEN]

POST v1/groups
{
    "name": "nama group"
}
```
__Response__ **200**
```json
{
    "message": "Success"
} 
```
__Bad Request__ **400**
```json
{
	"errors": "$REQUEST_ID|$ERROR_ID",
	"message": "Bad Request",
	"detail": {
            "name": "required"
	}
}
```
---
### Edit Group
__Host__ 
https://apidev.forky.id/cms/translation

__Request__
```json
Authorization: Bearer [TOKEN]

PATCH v1/groups
{
    "id": "encrypted_id",
    "name": "nama group"
}
```
__Response__ **200**
```json
{
    "message": "Success"
} 
```
__Bad Request__ **400**
```json
{
	"errors": "$REQUEST_ID|$ERROR_ID",
	"message": "Bad Request",
	"detail": {
            "id": "required",
            "name": "required"
	}
}
```
### Create a New Translation
__Host__ 
https://apidev.forky.id/cms/translation

__Request__
```json
Authorization: Bearer [TOKEN]

POST v1/translations
{
    "key": "login_button",
    "value": "Masuk",
    "group_id": "encrypted_id"
}
```
__Response__ **200**
```json
{
    "message": "Success"
} 
```
__Bad Request__ **400**
```json
{
	"errors": "$REQUEST_ID|$ERROR_ID",
	"message": "Bad Request",
	"detail": {
            "key": "required",
            "value": "required"
            "language_id": "required",
            "group_id": "required"
	}
}
```
---
### Edit Translation
__Host__ 
https://apidev.forky.id/cms/translation

__Request__
```json
Authorization: Bearer [TOKEN]

PATCH v1/translations
{
    "id": "encrypted_id",
    "value": "Masuk"
}
```
__Response__ **200**
```json
{
    "message": "Success"
} 
```
__Bad Request__ **400**
```json
{
	"errors": "$REQUEST_ID|$ERROR_ID",
	"message": "Bad Request",
	"detail": {
            "id": "required",
            "value": "required"
	}
}
```
---
### Remove Translation
__Host__ 
https://apidev.forky.id/cms/translation

__Request__
```json
Authorization: Bearer [TOKEN]

DELETE v1/translations
{
    "id": "encrypted_id"
}
```
__Response__ **200**
```json
{
    "message": "Success"
} 
```
__Bad Request__ **400**
```json
{
	"errors": "$REQUEST_ID|$ERROR_ID",
	"message": "Bad Request",
	"detail": {
            "id": "required"
	}
}
```
---
### Create a New Language
__Host__ 
https://apidev.forky.id/cms/translation

__Request__
```json
Authorization: Bearer [TOKEN]

POST v1/languages
{
    "code": "id-ID",
    "name": "Indonesia"
}
```
__Response__ **200**
```json
{
    "message": "Success"
} 
```
__Bad Request__ **400**
```json
{
	"errors": "$REQUEST_ID|$ERROR_ID",
	"message": "Bad Request",
	"detail": {
            "code": "required",
            "name": "required"
	}
}
```
---
### Edit Language
__Host__ 
https://apidev.forky.id/cms/translation

__Request__
```json
Authorization: Bearer [TOKEN]

PATCH v1/languages
{
    "id": "encrypted_id",
    "code": "id-ID",
    "name": "Indonesia"
}
```
__Response__ **200**
```json
{
    "message": "Success"
} 
```
__Bad Request__ **400**
```json
{
	"errors": "$REQUEST_ID|$ERROR_ID",
	"message": "Bad Request",
	"detail": {
            "id": "required",
            "code": "required",
            "name": "required"
	}
}
```
---
### Remove Language
__Host__ 
https://apidev.forky.id/cms/translation

__Request__
```json
Authorization: Bearer [TOKEN]

DELETE v1/languages
{
    "id": "encrypted_id"
}
```
__Response__ **200**
```json
{
    "message": "Success"
} 
```
__Bad Request__ **400**
```json
{
	"errors": "$REQUEST_ID|$ERROR_ID",
	"message": "Bad Request",
	"detail": {
            "id": "required"
	}
}
```
---