# API ticket creation example fails

**URL:** https://community.zammad.org/t/api-ticket-creation-example-fails/10348
**Category:** Technical assistance
**Created:** [November 11, 2022, 3:01pm UTC](https://community.zammad.org/t/api-ticket-creation-example-fails/10348 "2022-11-11T15:01:41Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![BenGig](https://community.zammad.org/user_avatar/community.zammad.org/bengig/32/6419_2.png) [@BenGig](https://community.zammad.org/u/BenGig)
#### Post date: [November 11, 2022, 3:01pm UTC](https://community.zammad.org/t/api-ticket-creation-example-fails/10348/1 "2022-11-11T15:01:41Z")

</div>

I try to reproduce the example here: [Tickets — Zammad System Documentation documentation](https://docs.zammad.org/en/latest/api/ticket/index.html#create)

The example has been pasted to _postman_, body type raw. Group and customer have been changed to valid values. Simple GET requests work fine.

```auto
{
   "title": "TEST TICKET",
   "group": "Juypter Hub",
   "customer": "this_mail_exists@ethz.ch",
   "article": {
      "subject": "TEST SUBJECT",
      "body": "I am a message!",
      "type": "note",
      "internal": false
   }
}

```

Response:

```auto
{
    "error": "The required value 'group_id' is missing.",
    "error_human": "The required value 'group_id' is missing."
}

```

I replaced `group` with `group_id`, with the ID I found in a ticket GET request, but without success.

### Background

In the end, we want to create tickets as _Shared Drafts_, mails which should be created unattended by a service, and edited by a team before being sent to the customers.

### Infos:

- Used Zammad version: 5.2.3
- Used Zammad installation type: source
- Operating system: RHEL 8.6
- Browser + version: postman

---

<div class="post-metadata">

### Author: ![richie\_77](https://community.zammad.org/user_avatar/community.zammad.org/richie_77/32/5964_2.png) [@richie\_77](https://community.zammad.org/u/richie_77)
#### Post date: [November 17, 2022, 8:51am UTC](https://community.zammad.org/t/api-ticket-creation-example-fails/10348/2 "2022-11-17T08:51:06Z")

</div>

Can you get the group information in a response to /api/v1/groups/{id}?  
Does the API-User have the correct rights on this group?

---

<div class="post-metadata">

### Author: ![BenGig](https://community.zammad.org/user_avatar/community.zammad.org/bengig/32/6419_2.png) [@BenGig](https://community.zammad.org/u/BenGig)
#### Post date: [November 18, 2022, 7:23am UTC](https://community.zammad.org/t/api-ticket-creation-example-fails/10348/3 "2022-11-18T07:23:49Z")

</div>

No, I can’t list the group information for the group id in question. I will contact the server admins and ask for the _admin.groups_ permission for a test run. The ticket creation endpoint mentions _ticket.agent_ permission only, but I will test and come back.

---

<div class="post-metadata">

### Author: ![richie\_77](https://community.zammad.org/user_avatar/community.zammad.org/richie_77/32/5964_2.png) [@richie\_77](https://community.zammad.org/u/richie_77)
#### Post date: [November 18, 2022, 8:30am UTC](https://community.zammad.org/t/api-ticket-creation-example-fails/10348/4 "2022-11-18T08:30:22Z")

</div>

I mean, that the user for them you have the api key needs at least read rights on the given group. You have to set up those rights on the user (agent) config. I think, that you don’t need admin rights.

![Zammad Groups](https://community.zammad.org/uploads/default/original/2X/3/382146151d472605488289abb0043d5c2449a97b.jpeg)

---

<div class="post-metadata">

### Author: ![BenGig](https://community.zammad.org/user_avatar/community.zammad.org/bengig/32/6419_2.png) [@BenGig](https://community.zammad.org/u/BenGig)
#### Post date: [November 18, 2022, 10:48am UTC](https://community.zammad.org/t/api-ticket-creation-example-fails/10348/5 "2022-11-18T10:48:56Z")

</div>

Sorry for wasting your time, my bad. I just found that a setting in Postman caused the problem. I sent the request body as _raw_, but let the type setting on _text_. Changing the type to _JSON_ fixed the problem.

---

<div class="post-metadata">

### Author: ![system](https://community.zammad.org/uploads/default/original/1X/5c5afaea2d23f811dbec33cd4edb02fa29d3262f.png) [@system](https://community.zammad.org/u/system)
#### Post date: [March 18, 2023, 10:48am UTC](https://community.zammad.org/t/api-ticket-creation-example-fails/10348/6 "2023-03-18T10:48:57Z")

</div>

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.
