Skip to content

Commit

Permalink
UPDATE: complete docs for analytics
Browse files Browse the repository at this point in the history
  • Loading branch information
BaggerFast committed Jun 2, 2024
1 parent 4b8c647 commit 20ada6f
Show file tree
Hide file tree
Showing 7 changed files with 83 additions and 6 deletions.
4 changes: 2 additions & 2 deletions doc-app/docs/api/admin/domains.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# Domains

In our system, "domains" are a carefully selected list of short domain names used to create shortened links.
Shorter domain names greatly enhance the efficiency and brevity of our service.

Expand Down Expand Up @@ -45,8 +44,8 @@ Shorter domain names greatly enhance the efficiency and brevity of our service.
- [Not valid](../misc/errors.md#notvalid)
- [Too many records](../misc/errors.md#tomanyrecords)


## GET
Get all domains
- Method: `GET`
- Url: `/api/v1/domains`

Expand All @@ -67,6 +66,7 @@ Get all domains
}
```


## DELETE / `{id}`
- Method: `DELETE`
- Url: `/api/v1/domains/{id}`
Expand Down
2 changes: 1 addition & 1 deletion doc-app/docs/api/anonymous/redirects.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ This entity records all user interactions with shortened links, collecting infor
### Example

```http
GET {{url}}/api/v1/redirects/link?domain=sh0.su&path=ml6v1s
GET /api/v1/redirects/link?domain=sh0.su&path=ml6v1s
```

### Errors
Expand Down
1 change: 1 addition & 0 deletions doc-app/docs/api/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,5 @@ are omitted from this documentation.

## Future soon
- Postgres
- Redis
- Easy deploy
17 changes: 17 additions & 0 deletions doc-app/docs/api/misc/errors.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Record by id not found
}
```


## IsUsing
The record cannot be deleted because it is referenced by other records.
- HttpCode: `409`
Expand All @@ -26,6 +27,7 @@ The record cannot be deleted because it is referenced by other records.
}
```


## NotUnique
The record cannot be created, because not unique
- HttpCode: `409`
Expand All @@ -38,6 +40,7 @@ The record cannot be created, because not unique
}
```


## ToManyRecords
The record cannot be created because the maximum count has been reached
- HttpCode: `422`
Expand All @@ -51,6 +54,7 @@ The record cannot be created because the maximum count has been reached
}
```


## NotValid
The record is invalid
- HttpCode: `422`
Expand All @@ -62,4 +66,17 @@ The record is invalid
"error": "BODY_NOT_VALID",
"invalidFields": ["field1", "field2"]
}
```


## FkNotFound
Foreign key record not found
- HttpCode: `404`
- On: `POST` `PUT` `GET`

### Example
```json
{
"error": "NESTED_RECORD_NOT_FOUND"
}
```
47 changes: 45 additions & 2 deletions doc-app/docs/api/user/analytics.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,53 @@
# Analytics
# Link Analytics
Track metrics of links such as devices, os system, unique views and etc.

### Base requirements
- Auth: `Bearer token`

## GET
- Url: `/api/v1/user/links/{id}/analytics`
- Method: `GET`

### Response (200)

```json
{
"data": {
"statistics": {
"views": 2,
"uniqueViews": 1
},
"devicesData": {
"os": [
{
"label": "windows",
"value": 2
}
],
"device": [
{
"label": "Mobile",
"value": 2
}
]
},
"viewsData": [
{
"label": "2024-05-26",
"value": 2
}
]
}
}
```

### Errors
- [Not found](../misc/errors.md#errors)


## DELETE / `{id}`
- Method: `DELETE`
- Method: `DELETE`
- Url: `/api/v1/user/links/{id}/analytics`

### Errors
- [Not found](../misc/errors.md#errors)
16 changes: 15 additions & 1 deletion doc-app/docs/api/user/links.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,28 @@ The entire service operates around this core entity!
- Method: `POST`
- Max elements for user: `100`


## GET
- Method: `GET`


## GET / `{id}`
- Method: `GET`

### Errors
- [Not found](../misc/errors.md#errors)


## UPDATE / `{id}`
- Method: `PUT`

### Errors
- [Not found](../misc/errors.md#errors)


## DELETE / `{id}`
- Method: `DELETE`
- Method: `DELETE`
- Url: `/api/v1/user/links/{id}`

### Errors
- [Not found](../misc/errors.md#errors)
2 changes: 2 additions & 0 deletions doc-app/docs/api/user/subdomains.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ Subdomains are important because all users interact with them directly, bypassin
- [Not unique](../misc/errors.md#notunique)
- [Not valid](../misc/errors.md#notvalid)
- [Too many records](../misc/errors.md#tomanyrecords)
- [Nested record not found](../misc/errors.md#fknotfound)


## GET
Expand Down Expand Up @@ -84,6 +85,7 @@ Get all user domains data
}
```


## DELETE / `{id}`
- Method: `DELETE`
- Url: `/api/v1/user/subdomains`
Expand Down

0 comments on commit 20ada6f

Please sign in to comment.