Unable to create a project via the API (project.template.id is invalid, although it does exist)

Good afternoon, 

I have an issue while I am trying to create a project. 

  • Endpoint: languagecloud.sdl.com/.../025707d21ecc0-create-project
  • X-LC-Tenant: LC-6687a5e46de0f00a5b4f6f50
  • X-LC-TraceId: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
  • Request URL: lc-api.sdl.com/.../projects
  • Request body:
    Fullscreen
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    { ·
    · · "description": "Api project.",
    · · "dueBy": "2024-07-23T10:03:29.850Z",
    · · "languageDirections": [
    · · · · {
    · · · · · · "sourceLanguage": {
    · · · · · · · · "languageCode": "en-US"
    · · · · · · },
    · · · · · · "targetLanguage": {
    · · · · · · · · "languageCode": "fr-FR"
    · · · · · · }
    · · · · },
    · · · · {
    · · · · · · "sourceLanguage": {
    · · · · · · · · "languageCode": "en-US"
    · · · · · · },
    · · · · · · "targetLanguage": {
    · · · · · · · · "languageCode": "nl-NL"
    · · · · · · }
    · · · · }
    · · ],
    XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
  • Response body:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
{
· · "errorCode": "invalid",
· · "message": "Invalid input on create project.",
· · "details": [
· · · · {
· · · · · · "name": "project.template.id",
· · · · · · "code": "invalid",
· · · · · · "value": "66963b09ea16e64bffa8528b"
· · · · }
· · ]
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

  • Expected result: The project is created.
  • Actual result: The project is not created due to projectTemplate.id is invalid ( although the project template id is stated in the portal).
  • Description: When attempting to create a new project, I get the error mentioned above.
emoji
Parents Reply
  • Hi Maria Miron,

    Yes it is solved as you mentioned. 


    However, in this case, the pricing model in creating project template must be mandatory, same as others mandatory steps. So, you should not allow users to create a project template without selecting pricing model. You should always protect users from being in these kind of situations.

    Thanks again. 
    Best regards,
    Ammar

Children
No Data