unable to create a service request using API v1

  • 26 February 2020
  • 0 replies
  • 67 views

We are having difficulty creating a service request from the catalog using the REST api.


reviewing the documentation:

https://api.freshservice.com/#create_a_service_request


it needs a "item_id":"123"


However there are no details on how to obtain this item_id.


We tried performing a "GET" against an existing ticket and

there were 2 id's "id" and "service_request_id" under

requested items and we also tryed the item_display_id

from the catalog item itself.


here is some of the output:

{
"requested_item": {
"id": 25000816737,
"service_request_id": 25010108683,
"quantity": 1,
"created_at": "2020-02-25T14:58:01-05:00",
"updated_at": "2020-02-25T14:58:01-05:00",
"remarks": null,
"from_date": null,
"to_date": null,
"location_id": null,
"item_type": 1,
"requested_item_values": {
"Date Required (minimum 2 weeks from request date)": "2020-02-28T00:00:00+00:00",

...

},
"stage_name": "Requested",
"catalog_item": "my request",
"item_display_id": 79
}
}




we then tried to send a "POST" with the values but it fails.

/catalog/request_items/[item_display_id]/service_request.json


Request:


{

"requested_item_values":{
"[item_display_id]":{
"item_id":"25000816737", <-- this is the ID we are not sure how to obtain
"quantity":"1",
"requested_item_value_attributes":{
"field":"value" <-- this is where we put our "answers"
}
}
},
"requested_for":"me@company.com",
"requester_email":"me@company.com"
}


Response:


{
"status": false,
"error_code": 400,
"errors": "Requested Item detail is not present"
}


i see 2 previous discussions with no response:

https://support.freshservice.com/support/discussions/topics/319178




0 replies

Join the Community or User Group to Participate in this Discussion

Reply