Last updated: 04.08.17 by Jonas Solsvik
HTTP Method
POST
URL
http://localhost:5000/api/translation
JSON body
{
"clientKey": "Ordbase",
"languageKey": "en",
"containerKey": "error_messages",
"key": "error_create_client",
"text": "default",
"isComplete": false
}
JSON body type
Translation
Status response codes
CREATED 201
BAD REQUEST 400
[HttpPost("api/translation")]
public IActionResult Create([FromBody] Translation translation)
{
if (translation == null)
return BadRequest();
return _translationRepo.Create(translation);
}
public IActionResult Create(Translation translation)
{
_context.Translation.Add(translation);
_context.SaveChanges();
return new StatusCodeResult(201);
}