# SliceIt URL Shortener : API Documentation

A URL Shortener with API Support.

Visit at [scit.me](https://scit.me)

Developed by [Tenzopy Digital](https://tenzopy.com)

# How to Retrieve API Token.

1\. Log into your [Profile](https://scit.me/profile/) of Sliceit.

2\. Use the **API Token** Button in the navbar to retrieve your token (Keep your API Token Secret).

3\. Add the API Token in the **Header** of every request.

| Key | Value |
| --- | --- |
| Authorization | Token &lt;your token&gt; |

* ## Slice a Link \[ POST Request \]
    

```plaintext
https://scit.me/api/slice/
```

### Body

* **backhalf** - The Back-Half part of the URL after the /
    
    eg : `scit.me/tenz`
    
* **url** - URL that is needed to be shortened.
    

### x-www-form-urlencoded

| Key | Value |
| --- | --- |
| url | https://tenzopy.com |
| backhalf | tenz |

### raw

```plaintext
{
    "url" : "https://tenzopy.com",
    "backhalf" : "tenz" 
}
```

### Output \[ 201 CREATED \]

```plaintext
{
    "stat": "true",
    "result": {
        "code": "tenz",
        "short_url": "scit.me/tenz",
        "full_short_url": "https://scit.me/tenz",
        "target_url": "https://tenzopy.com"
    }
}
```

### Errors

* **Backhalf Already Used \[ 409 CONFLICT \]**
    

```plaintext
{
    "stat": "false",
    "result": "backhalf already used."
}
```

* **Invalid URL \[ 400 BAD REQUEST \]**
    

```plaintext
{
    "stat": "false",
    "result": "invalid url"
}
```

* **Incomplete Keys \[ 400 BAD REQUEST \]**
    

---

* ## Delete a Link \[ DELETE Request \]
    

```plaintext
https://scit.me/api/remove/
```

### Body

* **code** - The code returned during slicing AKA Back-Half.
    
    eg : `scit.me/tenz` -&gt; code is **tenz**
    

### x-www-form-urlencoded

| Key | Value |
| --- | --- |
| code | tenz |

### raw

```plaintext
{
    "code" : "tenz"
}
```

### Output \[ 200 OK \]

```plaintext
{
    "stat": "true",
    "result": "link deleted"
}
```

### Errors

* **Invalid Code \[ 404 NOT FOUND \]**
    

```plaintext
{
    "stat": "false",
    "result": "not found"
}
```

* **Trying to delete Unauthorized Link/Code \[ 403 FORBIDDEN \]**
    

```plaintext
{
    "stat": "false",
    "result": "forbidden"
}
```

* **Incomplete Keys \[ 400 BAD REQUEST \]**
    

---

* ## About a Link \[ GET Request \]
    

```plaintext
https://scit.me/api/info
```

### **Query Params**

* **code** - The code returned during slicing AKA Back-Half.
    
    eg : `scit.me/tenz` -&gt; code is **tenz**
    

### Output \[ 200 OK \]

```plaintext
{
    "stat": "true",
    "result": {
        "code": "tenz",
        "short_url": "scit.me/tenz",
        "full_short_url": "https://scit.me/tenz",
        "target_url": "https://tenzopy.com",
        "is_active": true,
        "clicks": 2
    }
}
```

### Errors

* **Invalid Code \[ 404 NOT FOUND \]**
    
    ```plaintext
    {
        "stat": "false",
        "result": "not found"
    }
    ```
    
* **Trying to access Unauthorized Link/Code \[ 403 FORBIDDEN \]**
    
    ```plaintext
    {
        "stat": "false",
        "result": "forbidden"
    }
    ```
    
* **Incomplete Keys \[ 400 BAD REQUEST \]**
    

---

* ## Enable/Disable A Link \[ PATCH Request \]
    

```plaintext
https://scit.me/api/active/
```

### **Body**

* **code** - The code returned during slicing AKA Back-Half.
    
    eg : `scit.me/tenz` -&gt; code is **tenz**
    
* **status** - True/False , The link should be enabled or disabled.
    

### raw

```plaintext
{
    "code" : "tenz",
    "status" : true
}
```

### Output \[ 200 OK \]

```plaintext
{
    "stat": "true",
    "result": "link enabled"
}
```

### Errors

* **Invalid Code \[ 404 NOT FOUND \]**
    
    ```plaintext
    {
        "stat": "false",
        "result": "not found"
    }
    ```
    
* **Trying to access Unauthorized Link/Code \[ 403 FORBIDDEN \]**
    
    ```plaintext
    {
        "stat": "false",
        "result": "forbidden"
    }
    ```
    
* **Incomplete/Invalid Keys \[ 400 BAD REQUEST \]**
    

---
