# Location

# Get All Locations

# Resource URL

https://humtog.com/api/country

# Resource Method

GET

# Example Response

{
     "error": false,
    "data": [
        {
            "id": 1,
            "code": "GL",
            "name": "Global",
            "avatar": null,
            "thumbnail": null,
            "description": null,
            "status": 0,
            "tagline": "",
            "slug": "global",
            "cover": null
        },
        ...
    ]
}

# Get All Active Locations

# Resource URL

https://humtog.com/api/locations

# Resource Method

GET

# Example Response

{
     "error": false,
    "data": [
        {
            "id": 1,
            "code": "GL",
            "name": "Global",
            "avatar": null,
            "thumbnail": null,
            "description": null,
            "status": 0,
            "tagline": "",
            "slug": "global",
            "cover": null
        },
        ...
    ]
}

# Get Current Location Data

# Resource URL

https://humtog.com/api/feed/location

# Resource Method

GET

# Params

Name Required Type Description
location Yes string Location slug

# Example Response

{
     "data": 
     {
        "id": 1,
        "code": "GL",
        "name": "Global",
        "avatar": null,
        "thumbnail": null,
        "description": null,
        "status": 0,
        "tagline": "",
        "slug": "global",
        "cover": ""
    }
}

# Get All Submissions For Current Location

# Resource URL

https://humtog.com/api/feed/perLocation

# Resource Method

GET

# Params

Name Required Type Description
locationName Yes string Location slug
filter Yes string Fileter submissions by all or subscribed, default all
sort Yes string Can be all, serious or relaxed, default all

# Example Response

{
    "data": [
        {
            "id": 6,
            "slug": "postSlug",
            "channel_id": 3,
            "channel_name": "Technology",
            "channel_title": "Technology",
            "location": {...},
            "user_id": 1,
            "title": "postTitle",
            "upvote": {...},
            "downvote": {...},
            "type": "text",
            ....
        },
        ...
    ],
    "links": {
        "first": "https://humtog.com/api/feed/perLocation?page=1",
        "last": "https://humtog.com/api/feed/perLocation?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "path": "https://humtog.com/api/feed/perLocation",
        "per_page": 15,
        "to": 2,
        "total": 2
    }
}

# Create Location

# Resource URL

https://humtog.com/api/location

# Resource Method

POST

# Params

Name Required Type Description
name Yes string Location name
description Yes string Description of location visible to user
code Yes string Location code, for example GB
tagline Yes string Location tagline
avatar Yes string Location image
thumbnail Yes string Location thumbnail
status Yes boolean Status of location

# Example Response

{
    'error' => false, 
    'message' => 'location Created Successfully'
}

# Add Image to Location

# Resource URL

https://humtog.com/api/location/:location_slug/photo

# Resource Method

POST

# Params

Name Required Type Description
photo Yes file Location image

# Response

Response returns image full path.