Skip to main content
Solved

"this field cannot be empty" error message when attempting to create a solution article via API


Forum|alt.badge.img

When I attempt to create a solution article from URL using the Article creation API, I get the following errors: 

 "description""Validation failed",

    "errors": [

        {

            "field": "title",

            "message": "This field cannot be empty",

            "code": "missing_field"

        },

        {

            "field": "description",

            "message": "This field cannot be empty",

            "code": "missing_field"

        },

        {

            "field": "folder_id",

            "message": "This field cannot be empty",

            "code": "missing_field"

        },

        {

            "field": "status",

            "message": "This field cannot be empty",

            "code": "missing_field"

        }

    ]

I have all of these values set in the API call.  I have tried all sorts of formatting to make sure that the values are the correct type as well.  I am using postman currently, but I have also tried just running this in powershell with the same result.  I am sure that there is something that I am missing, but I cannot figure out what it is.

Has anyone seen something like this and been able to get around it?

Thanks!

Best answer by zachary.king

@Justin_M have you tried formatting your curl request as suggested in the Freshservice API documentation?

https://api.freshservice.com/v2/#create_solution_article

View original
Did this topic help you find an answer to your question?

6 replies

zachary.king
Skilled Expert
Forum|alt.badge.img+16
  • Skilled Expert
  • 951 replies
  • January 3, 2024

Hello @Justin_M, can you share with us the endpoint you are calling to “create a solution article”, and the JSON body you are passing in your POST request? We don’t need the actual values for the fields but it will help us troubleshoot your issue. Thanks!


Forum|alt.badge.img
  • Author
  • Contributor
  • 3 replies
  • January 3, 2024

Thank you for the response.  Here is an example of what I am sending over: 

curl -L -X POST 
"https://[company].freshservice.com/api/v2/solutions/articles?title="article test"&description="This is an API test article"&folder_id=[folder_id]&status=1" -H "Content-Type: application/json" -H "Authorization: Basic [API key]"

Edit: Wanted to clarify that I am using the freshservice domain and not our vanity URL


zachary.king
Skilled Expert
Forum|alt.badge.img+16
  • Skilled Expert
  • 951 replies
  • Answer
  • January 3, 2024

@Justin_M have you tried formatting your curl request as suggested in the Freshservice API documentation?

https://api.freshservice.com/v2/#create_solution_article


Forum|alt.badge.img
  • Author
  • Contributor
  • 3 replies
  • January 3, 2024

I am trying that now, I ran into some issues with curl.exe being unhappy with the curly brackets and then an issue with the title being picked up as a domain.  I am going to poke around a little more and will circle back once I can get around those issues.

 

Thank you for the help!


Forum|alt.badge.img
  • Author
  • Contributor
  • 3 replies
  • January 3, 2024

Following your suggestion, I was able to get rid of that error, and now I am getting a 403 forbidden, but only when attempting to POST.

I will mark this as resolved, and I will hunt down the other issue and open another topic if needed at that time.

Thank you for taking the time!


zachary.king
Skilled Expert
Forum|alt.badge.img+16
  • Skilled Expert
  • 951 replies
  • January 3, 2024
Justin_M wrote:

Following your suggestion, I was able to get rid of that error, and now I am getting a 403 forbidden, but only when attempting to POST.

I will mark this as resolved, and I will hunt down the other issue and open another topic if needed at that time.

Thank you for taking the time!

No problem! Glad you are making progress. For the 403 Forbidden error, you need to make sure the API key you are passing has the right privileges to create solution articles


Reply