---
# System prepended metadata

title: Zammad

---


# Zammad
```sequence
Zammad->Zammad: Create access token
App->Zammad: search user by token /api/v1/users/search?query=organization.name:{search string}&limit=1
Zammad->App: No: Create a zammad user with their email&password
Zammad->App: Yes: get user at position 0
App->Zammad: Get user info
Zammad->App: unAuth: use the access token to update the password
Zammad->App: update and use the new token for get tickets
Zammad->App: Auth: use the new token for get tickets
```

Admin token: ```-1iQOSGnql6BQjD1QxOH19laWUEHjWiXAH9a_0Zevu6fzXqRpr_F1psJNVNlXQxt```


## Search
```
curl --location --globoff 'https://help.tracki.com/api/v1/users/search?query=email&limit=50&role_ids[]=3' \
--header 'Authorization: Token token=<Admin token>'
```

## Create user
```
curl --location 'https://help.tracki.com/api/v1/users' \
--header 'Authorization: Token token=<Admin token>' \
--header 'Content-Type: application/json' \
--data-raw '{
  "firstname": "Jane",
  "lastname": "Doe",
  "email": "jdoe1@example.com",
  "login": "jdoe",
  "verified": true,
  "password": "11111111",
  "roles": [
      "Customer"
   ]
}'
```

## Update user by user_id
```
curl --location --request PUT 'https://help.tracki.com/api/v1/users/<user_id>' \
--header 'Authorization: Token token=<Admin token>' \
--header 'Content-Type: application/json' \
--data '{
  "firstname": "Jane",
  "lastname": "Micle",
  "password": "22222222"
  
}'
```

## Get users/me
```
curl --location --request GET 'https://help.tracki.com/api/v1/users/me' \
--header 'Authorization: Basic {username:password}' \

```

## Solution1: Get tickets by email
```
curl --location --request GET 'https://help.tracki.com/api/v1/tickets/search?query=<email>&limit=50&role_ids[]=3' \
--header 'Authorization: Token token=<Admin token>' 
```

## Solution2: Get tickets using basic auth
```
curl --location --request GET 'https://help.tracki.com/api/v1/tickets' \
--header 'Authorization: Basic {username:password}' 
```

## S1: Detail of ticket
```
curl --location --request GET 'https://help.tracki.com/api/v1/tickets/<ticket_id>' \
--header 'Authorization: Token token=<Admin token>' 
```

## S2: Detail of ticket using basic auth
```
curl --location --request GET 'https://help.tracki.com/api/v1/tickets/<ticket_id>' \
--header 'Authorization: Basic {username:password}' 
```