Skip to main content

I’m attempting to create and then update a service catalog entry. Creation goes extremely well. For example when I run

 

```

curl \
  -u "${TOKEN}:X" \
  -H "Content-Type: application/json" \
  -X POST \
  -d @payload.json \
  https://example.freshservice.com/api/v2/service-catalog/items

```

 

Where `payload.json` is (with the category_id filled in with a valid value):

 

```

{
  "service_item": {
    "name": "Item Name",
    "category_id": redacted,
    "short_description": "Apple Macbook Pro 13 inch",
    "description": "<p>Apple Macbook Pro 13 inch - 8 GB</p>",
    "visibility": 2
  },
  "workspace_id": 2
}

```

 

I receive notice that the entry has been created.

 

```

{"service_item":{"id":redacted,"created_at":"2024-02-01T00:00:00Z","updated_at":"2024-02-01T00:00:00Z","name":"Item Name","delivery_time":null,"display_id":123,"category_id":redacted,"product_id":null,"quantity":null,"deleted":false,"icon_name":"service-catalog-services-default","group_visibility":1,"agent_group_visibility":1,"item_type":1,"ci_type_id":null,"visibility":2,"workspace_id":2,"cost_visibility":false,"delivery_time_visibility":false,"botified":false,"allow_attachments":false,"allow_quantity":false,"is_bundle":false,"create_child":false,"configs":{"attachment_mandatory":false,"subject":"Request for {{requested_for}}: {{item.name}}"},"description":"<p>Apple Macbook Pro 13 inch - 8 GB</p>","short_description":"Apple Macbook Pro 13 inch","desc_un_html":" Apple Macbook Pro 13 inch - 8 GB ","cost":null,"agent_group_visibilities":{"group_id":i]},"agent_workspace_visibilities":{"workspace_ids":l]},"custom_fields":i],"child_items":f],"icon_url":"redacted.png"}}

```

 

At this point, I would like to update the item in place to have it reflect newer information. I have tried POSTing to the same URL again in the hopes that it would update the value but I get the error message:

 

```

{"description":"Validation failed","errors":a{"field":"name","message":"Name has already been taken","code":"invalid_value"}]}

```

 

I have also tried posting to the URL implied by the `GET` documentation

 

```

curl \
  -v \
  -u ${TOKEN}:X \
  -X POST \
  -H "Content-Type: application/json" \
  https://example.freshservice.com/api/v2/service_catalog/items/123
```

 

But am met with the following:

 

```

{"message":"POST method is not allowed. It should be one of these method(s): GET, HEAD"}

```

 

I’ve now read through the API documentation (https://api.freshservice.com/#create_service_catalog_item) several times, but don’t see documented the method for updating service catalog entries. Could you please point me to the method for achieving this?

Hello,

Per the API documentation it looks like the service request APIs only support POST and GET. 

PUT is the method that should be used for updating data/items.

But since this is not an allowed method for the service catalog/item, it seems these updates would need to be done via the admin portal/area for Service Catalog.


There are no API support for updating service items as @tnerbb sas. 

Need to be done by hand.