Question

Create a new asset validation error

  • 23 September 2021
  • 1 reply
  • 24 views

I can get a list of my assets fine using postman but when i try and create a new asset using an existing asset_type_id but it is not accepted and i get following error. What is wrong here? Here is the url used with my post. I am also only giving the 2 mandatory parameters.

 

https://kvik.freshservice.com/api/v2/assets?name=test1&asset_type_id=27000443966

 

{

"description": "Validation failed",

"errors": [

{

"field": "asset_type_id",

"message": "It should not be blank as this is a mandatory field",

"code": "invalid_value"

}

]

}


1 reply

Userlevel 2
Badge +5

Hi @kevnmortimer,

 

Greetings from Freshservice!

You have to pass the payload in JSON format. We don’t support the parameters if they are passed in the URL itself. So please try the below format:

POST https://kvik.freshservice.com/api/v2/assets

Payload: { "name": "test1","asset_type_id":27000443966

 

You can also call this Curl command:

curl -v -u user@yourcompany.com:test -H "Content-Type: application/json" -X POST -d '{ "name": "test1","asset_type_id":27000443966}' 'https://kvik.freshservice.com/api/v2/assets'
Sample screenshot of a successful call in POSTMAN

 

 

 

 

 

 

 

 

 

 

 

We hope this helps. Cheers!

 

Warm Regards,

Sanofar

Team Freshservice

Reply