Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes #302 - Added VIP attribute in API > Organization #322

Merged
merged 4 commits into from
Aug 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
171 changes: 87 additions & 84 deletions api/organization.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ List

Required permission: ``ticket.agent`` **or** ``admin.organization``

.. note::
.. note::

Technically any, customers can only see their own organization
Technically, customers can only see their own organization
if applicable.

``GET``-Request sent: ``/api/v1/organizations``
Expand All @@ -31,47 +31,53 @@ Response:
"note": "",
"updated_by_id": 1,
"created_by_id": 1,
"created_at": "2021-11-03T11:51:13.683Z",
"updated_at": "2021-11-03T11:51:13.822Z",
"created_at": "2023-07-26T08:44:39.608Z",
"updated_at": "2023-08-04T12:02:00.018Z",
"vip": false,
"member_ids": [
2
]
],
"secondary_member_ids": []
},
{
"id": 2,
"name": "Chrispresso Inc.",
"shared": true,
"domain": "",
"domain_assignment": false,
"active": true,
"note": "Manufacturer of individual coffee products.",
"updated_by_id": 1,
"vip": false,
"updated_by_id": 3,
"id": 2,
"created_by_id": 1,
"created_at": "2021-11-03T11:57:15.817Z",
"updated_at": "2021-11-03T11:57:15.817Z",
"created_at": "2023-07-26T08:44:48.617Z",
"updated_at": "2023-08-04T12:01:44.370Z",
"member_ids": [
3,
5,
4,
3
]
4
],
"secondary_member_ids": []
},
{
"id": 3,
"name": "Awesome Customer Inc.",
"shared": true,
"domain": "",
"domain_assignment": false,
"active": true,
"note": "Global distributor of communication and security products, electrical and electronic wire & cable.",
"updated_by_id": 1,
"vip": true,
"updated_by_id": 3,
"id": 3,
"created_by_id": 1,
"created_at": "2021-11-03T11:57:15.825Z",
"updated_at": "2021-11-03T11:57:15.825Z",
"created_at": "2023-07-26T08:44:48.632Z",
"updated_at": "2023-08-04T12:54:30.974Z",
"member_ids": [
8,
7,
6
]
],
"secondary_member_ids": []
},
{
"id": 4,
Expand All @@ -83,25 +89,12 @@ Response:
"note": "Search the world's information, including webpages, images, videos and more. Good Customer has many special features to help you find exactly what you're looking for.",
"updated_by_id": 1,
"created_by_id": 1,
"created_at": "2021-11-03T11:57:15.839Z",
"updated_at": "2021-11-03T11:57:15.839Z",
"created_at": "2023-07-26T08:44:48.645Z",
"updated_at": "2023-07-26T08:44:48.645Z",
"member_ids": [
9
]
},
{
"id": 5,
"name": "Test",
"shared": true,
"domain": "",
"domain_assignment": false,
"active": true,
"note": "",
"updated_by_id": 3,
"created_by_id": 3,
"created_at": "2021-11-03T14:42:28.555Z",
"updated_at": "2021-11-03T15:04:03.149Z",
"member_ids": []
],
"secondary_member_ids": []
}
]

Expand All @@ -124,56 +117,61 @@ Response:

[
{
"id": 4,
"name": "Good Customer Inc.",
"name": "Awesome Customer Inc.",
"shared": true,
"domain": "",
"domain_assignment": false,
"active": true,
"note": "Search the world's information, including webpages, images, videos and more. Good Customer has many special features to help you find exactly what you're looking for.",
"updated_by_id": 1,
"note": "Global distributor of communication and security products, electrical and electronic wire & cable.",
"vip": true,
"updated_by_id": 3,
"id": 3,
"created_by_id": 1,
"created_at": "2021-11-03T11:57:15.839Z",
"updated_at": "2021-11-03T11:57:15.839Z",
"created_at": "2023-07-26T08:44:48.632Z",
"updated_at": "2023-08-04T12:54:30.974Z",
"member_ids": [
9
]
8,
7,
6
],
"secondary_member_ids": []
},
{
"id": 3,
"name": "Awesome Customer Inc.",
"name": "Chrispresso Inc.",
"shared": true,
"domain": "",
"domain_assignment": false,
"active": true,
"note": "Global distributor of communication and security products, electrical and electronic wire & cable.",
"updated_by_id": 1,
"note": "Manufacturer of individual coffee products.",
"vip": false,
"updated_by_id": 3,
"id": 2,
"created_by_id": 1,
"created_at": "2021-11-03T11:57:15.825Z",
"updated_at": "2021-11-03T11:57:15.825Z",
"created_at": "2023-07-26T08:44:48.617Z",
"updated_at": "2023-08-04T12:01:44.370Z",
"member_ids": [
8,
7,
6
]
3,
5,
4
],
"secondary_member_ids": []
},
{
"id": 2,
"name": "Chrispresso Inc.",
"id": 4,
"name": "Good Customer Inc.",
"shared": true,
"domain": "",
"domain_assignment": false,
"active": true,
"note": "Manufacturer of individual coffee products.",
"note": "Search the world's information, including webpages, images, videos and more. Good Customer has many special features to help you find exactly what you're looking for.",
"updated_by_id": 1,
"created_by_id": 1,
"created_at": "2021-11-03T11:57:15.817Z",
"updated_at": "2021-11-03T11:57:15.817Z",
"created_at": "2023-07-26T08:44:48.645Z",
"updated_at": "2023-07-26T08:44:48.645Z",
"member_ids": [
5,
4,
3
]
9
],
"secondary_member_ids": []
}
]

Expand All @@ -182,9 +180,9 @@ Show

Required permission: ``ticket.agent`` **or** ``admin.organization``

.. note::
.. note::

Technically any - users in question can only see their own organization.
Technically any users in question can only see their own organization.

``GET``-Request sent: ``/api/v1/organizations/{id}``

Expand All @@ -203,15 +201,17 @@ Response:
"domain_assignment": false,
"active": true,
"note": "Manufacturer of individual coffee products.",
"updated_by_id": 1,
"vip": false,
"updated_by_id": 3,
"created_by_id": 1,
"created_at": "2021-11-03T11:57:15.817Z",
"updated_at": "2021-11-03T11:57:15.817Z",
"created_at": "2023-07-26T08:44:48.617Z",
"updated_at": "2023-08-04T12:01:44.370Z",
"member_ids": [
3,
5,
4,
3
]
4
],
"secondary_member_ids": []
}

Create
Expand All @@ -229,14 +229,15 @@ Required permission: ``admin.organization``
"domain": "example.com",
"domain_assignment": true,
"active": true,
"vip": true,
"note": "Just a sample, aint that nice?",
"members": [
"olivia@example.com",
"jdoe",
"david@example.com"
]
}


Response:

.. code-block:: json
Expand All @@ -245,7 +246,7 @@ Response:
# HTTP-Code 201 Created

{
"id": 6,
"id": 5,
"name": "Sample Corp.",
"shared": false,
"domain": "example.com",
Expand All @@ -254,13 +255,14 @@ Response:
"note": "Just a sample, aint that nice?",
"updated_by_id": 3,
"created_by_id": 3,
"created_at": "2021-11-03T17:38:39.527Z",
"updated_at": "2021-11-03T17:38:39.768Z",
"created_at": "2023-08-08T09:12:42.023Z",
"updated_at": "2023-08-08T09:12:42.602Z",
"vip": true,
"member_ids": [
10,
16,
11
]
],
"secondary_member_ids": []
}

Update
Expand All @@ -278,7 +280,7 @@ Required permission: ``admin.organization``
"domain": "",
"domain_assignment": false,
"active": true,
"note": "This was a triump - I'm making a note here - H-U-G-E success!",
"note": "This was a triumph - I'm making a note here - H-U-G-E success!",
"members": [
"olivia@example.com",
"david@example.com"
Expand All @@ -293,23 +295,24 @@ Response:
# HTTP-Code 200 Ok

{
"id": 6,
"id": 5,
"name": "Sample Corp.",
"shared": false,
"domain": "",
"domain_assignment": false,
"active": true,
"note": "This was a triump - I'm making a note here - H-U-G-E success!",
"note": "This was a triumph - I'm making a note here - H-U-G-E success!",
"updated_by_id": 3,
"created_by_id": 3,
"created_at": "2021-11-03T17:38:39.527Z",
"updated_at": "2021-11-03T17:40:59.740Z",
"created_at": "2023-08-08T09:12:42.023Z",
"updated_at": "2023-08-08T09:16:58.922Z",
"vip": true,
"member_ids": [
11,
10
]
10,
11
],
"secondary_member_ids": []
}

Delete
======

Expand Down
Loading