Discussions

Ask a Question
Back to All

Issues with submitting application answers and custom attributes with application creation

Hi there,

I'm getting two different issues when including answers and custom_attributes as relationships during application creation.

500 with custom_attributes

Receiving a 500 error when submitting a custom_attribute of type text as part of the create application request. I can't give much more information besides the JSON request object at the end of this message.

422 Validation issue with answers

Getting these validation errors when submitting answers:

data: {
  "errors": [
    {
      "code": "unprocessable_entity",
      "status": "422",
      "title": "Validation Error",
      "detail": "Title can't be blank",
      "source": {
        "pointer": "/data/attributes/title"
      },
      "meta": {
        "relationship": {
          "attribute": "title",
          "message": "can't be blank",
          "code": "blank",
          "name": "answers",
          "type": "answers",
          "temp-id": "1"
        }
      }
    },
    {
      "code": "unprocessable_entity",
      "status": "422",
      "title": "Validation Error",
      "detail": "Question type can't be blank",
      "source": {
        "pointer": "/data/attributes/question_type"
      },
      "meta": {
        "relationship": {
          "attribute": "question_type",
          "message": "can't be blank",
          "code": "blank",
          "name": "answers",
          "type": "answers",
          "temp-id": "1"
        }
      }
    },
    {
      "code": "unprocessable_entity",
      "status": "422",
      "title": "Validation Error",
      "detail": "Question must exist",
      "source": {
        "pointer": "/data/relationships/question"
      },
      "meta": {
        "relationship": {
          "attribute": "question",
          "message": "must exist",
          "code": "blank",
          "name": "answers",
          "type": "answers",
          "temp-id": "1"
        }
      }
    }
  ]
}

I have double checked the question ID exists, but might there be anything else causing the API to think it doesn't exist? Also it doesnt make too much sense re title and question type unless these are undocumented fields that need to be provided.

I've included a partial request object so you can check if they are well formed or not.

Any help would greatly be appreciated.

Best,
Luke



{
  "relationships": {
    "job": {
      "data": {
        "type": "jobs",
        "id": "JOBID"
      }
    },
    "stage": {
      "data": {
        "type": "stages",
        "id": "STAGEID"
      }
    },
    "custom_attributes": {
      "data": [
        {
          "type": "custom_attributes",
          "temp-id": "1",
          "method": "create"
        }
      ]
    }
  },
  "included": [
    {
      "type": "custom_attributes",
      "attributes": {
        "varchar_value": "A text value"
      },
      "relationships": {
        "custom_field": {
          "data": {
            "type": "custom_fields",
            "id": "CUSTOMFIELDID"
          }
        }
      },
      "temp-id": "1"
    }
  ]
}


{
    "relationships": {
      "job": {
        "data": {
          "type": "jobs",
          "id": "JOBID"
        }
      },
      "stage": {
        "data": {
          "type": "stages",
          "id": "STAGEID"
        }
      },
      "answers": {
        "data": [
          {
            "type": "answers",
            "temp-id": "1",
            "method": "create"
          }
        ]
      }
    },
    "included": [
      {
        "type": "answers",
        "temp-id": "1",
        "attributes": {
          "boolean_answer": true
        },
        "relationships": {
          "question": {
            "data": {
              "type": "questions",
              "id": "QUESTIONID"
            }
          }
        }
      }
    ]
  }