NAV
bash javascript

Info

Welcome to the API reference for Client Get Postman Collection

Clicks

Get Clicks By Date


Requires authentication Return the number of clicks. If is given user_id - connected to that user. Between the from and to dates if not given - for today.

Example request:

curl -X GET \
    -G "https://api.metapic.com/clicks/by-date/1?from=ratione&to=error" 
const url = new URL(
    "https://api.metapic.com/clicks/by-date/1"
);

let params = {
    "from": "ratione",
    "to": "error",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

fetch(url, {
    method: "GET",
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "{userEmail}": {
        "day": [
            {
                "date": "2020-02-17",
                "link_clicks": 262,
                "tag_clicks": 0,
                "user_id": 838,
                "email": "{userEmail}"
            },
            "..."
        ],
        "total": 58687
    }
}

HTTP Request

GET clicks/by-date/{user_id?}

URL Parameters

Parameter Status Description
user_id optional The id of the user to fetch clicks for.

Query Parameters

Parameter Status Description
from optional Date (Y-m-d). Valid date datetime format 2014-11-08 10:24 as string. Example 2014-11-08 10:24
to optional Date (Y-m-d). Valid date datetime format 2014-11-08 10:24 as string. Example 2014-11-08 10:24

Get Clicks


Requires authentication Return the number of clicks. Between the from and to dates if not given for today.

Example request:

curl -X GET \
    -G "https://api.metapic.com/clicks?from=quae&to=temporibus" 
const url = new URL(
    "https://api.metapic.com/clicks"
);

let params = {
    "from": "quae",
    "to": "temporibus",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

fetch(url, {
    method: "GET",
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

[
    {
        "email": "{userEmail}",
        "tag_clicks": 0,
        "link_clicks": 16259,
        "total_clicks": 16259,
        "user_revenue": 853070,
        "client_revenue": 0,
        "affiliate": 0,
        "user_id": "{userId}",
        "sum_sek": "15290",
        "ut_user_id": 838
    },
    "..."
]

HTTP Request

GET clicks

Query Parameters

Parameter Status Description
from optional Date (Y-m-d). Valid date datetime format 2014-11-08 10:24 as string. Example 2014-11-08 10:24
to optional Date (Y-m-d). Valid date datetime format 2014-11-08 10:24 as string. Example 2014-11-08 10:24

Get User Clicks


Requires authentication Return the number of clicks. If is given user_id - connected to that user. Between the from and to dates if not given - for today.

Example request:

curl -X GET \
    -G "https://api.metapic.com/clicks/1?from=consequatur&to=perferendis" 
const url = new URL(
    "https://api.metapic.com/clicks/1"
);

let params = {
    "from": "consequatur",
    "to": "perferendis",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

fetch(url, {
    method: "GET",
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "email": "{userEmail}",
    "tag_clicks": 0,
    "link_clicks": 16259,
    "total_clicks": 16259,
    "user_revenue": 853070,
    "client_revenue": 0,
    "affiliate": 0,
    "user_id": "{userId}",
    "sum_sek": "15290",
    "ut_user_id": 838
}

HTTP Request

GET clicks/{click}

URL Parameters

Parameter Status Description
user_id required The id of the user to fetch clicks for.

Query Parameters

Parameter Status Description
from optional Date (Y-m-d). Valid date datetime format 2014-11-08 10:24 as string. Example 2014-11-08 10:24
to optional Date (Y-m-d). Valid date datetime format 2014-11-08 10:24 as string. Example 2014-11-08 10:24

DeepLinking

DeepLink BlogPost


Requires authentication Transform a html blocks links to metapic links. Will only transform links that you can earn money on

Example request:

curl -X POST \
    "https://api.metapic.com/deepLinkBlogPost/1" \
    -H "Content-Type: application/json" \
    -d '{"blogPost":"<div> <a href=\"https:\/\/na-kd.com\"> link<\/a><\/div>"}'
const url = new URL(
    "https://api.metapic.com/deepLinkBlogPost/1"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "blogPost": "<div> <a href=\"https:\/\/na-kd.com\"> link<\/a><\/div>"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "newHtml": "<div> <a href=\"https:\/\/c.mtpc.se\/tags\/link\/2082970\"> link<\/a><\/div>",
    "linkTranslation": [
        {
            "before": "https:\/\/na-kd.com",
            "status": "success",
            "store": "NA-KD",
            "storeId": 12,
            "type": "tradedoubler_SE",
            "after": "https:\/\/c.mtpc.se\/tags\/link\/2082970",
            "currency": "SEK",
            "tag_id": 2082970,
            "user_revenue_cpc": 0,
            "user_instagram_cpc": 0,
            "user_revenue_cpa": 0,
            "user_instagram_cpa": 0,
            "user_revenue_cpc_formated": "0 öre",
            "user_instagram_cpc_formated": "0 öre"
        }
    ],
    "isUpdated": true
}

HTTP Request

POST deepLinkBlogPost/{id}

URL Parameters

Parameter Status Description
user_id optional The id of the user.

Body Parameters

Parameter Type Status Description
blogPost string required Link".

Create Deep Links


Requires authentication Create deeplinks from a array of links

Example request:

curl -X POST \
    "https://api.metapic.com/deep-links" \
    -H "Content-Type: application/json" \
    -d '{"links":"[\\\"https:\/\/na-kd.com\\\"]","userId":1}'
const url = new URL(
    "https://api.metapic.com/deep-links"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "links": "[\\\"https:\/\/na-kd.com\\\"]",
    "userId": 1
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

[
    {
        "before": "https:\/\/na-kd.com",
        "status": "success",
        "store": "NA-KD",
        "storeId": "{storeId}",
        "type": "tradedoubler_SE",
        "after": "https:\/\/c.mtpc.se\/tags\/link\/2082974",
        "currency": "SEK",
        "tag_id": "{tagId}",
        "user_revenue_cpc": 0,
        "user_instagram_cpc": 0,
        "user_revenue_cpa": 0,
        "user_instagram_cpa": 0,
        "user_revenue_cpc_formated": "0 öre",
        "user_instagram_cpc_formated": "0 öre"
    },
    "..."
]

HTTP Request

POST deep-links

Body Parameters

Parameter Type Status Description
links string required Json array of links.
userId integer required The user ID.

Images

Get Images


Requires authentication Returns all images connected to your client account, sorted on created date in descending order. If a user_id is provided it will return all images related to that user.

Example request:

curl -X GET \
    -G "https://api.metapic.com/images?user_id=1&include_tags=1" 
const url = new URL(
    "https://api.metapic.com/images"
);

let params = {
    "user_id": "1",
    "include_tags": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

fetch(url, {
    method: "GET",
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

[
    {
        "id": 66,
        "url": "http:\/\/metapic.se\/images\/uploads\/ff109a2256deb195c9190befb0d7518c9ab497a3-1344632617.jpg",
        "site": "",
        "user_id": 709,
        "ip": "90.142.161.51",
        "width": 393,
        "height": 500,
        "ratio": 0.786,
        "created_at": "2012-08-10 21:04:34",
        "updated_at": "2012-08-10 21:04:34",
        "deleted_at": null,
        "collage_id": null,
        "favorite": 0,
        "show_store": 0
    },
    "..."
]

HTTP Request

GET images

Query Parameters

Parameter Status Description
user_id optional integer. The id of the user to fetch images from. Unsigned integer.
include_tags optional boolean. Whether to include the image tags in the request. Boolean.

Create Image


Requires authentication Create a new Metapic image. The image will automatically be linked to your account.

Example request:

curl -X POST \
    "https://api.metapic.com/images" \
    -H "Content-Type: application/json" \
    -d '{"user_id":1,"url":"http:\/\/example.com\/image.jpeg","site":"http:\/\/myblog.com\/","width":123,"height":123}'
const url = new URL(
    "https://api.metapic.com/images"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "user_id": 1,
    "url": "http:\/\/example.com\/image.jpeg",
    "site": "http:\/\/myblog.com\/",
    "width": 123,
    "height": 123
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "id": 1,
    "user_id": "{userId}",
    "url": "http:\/\/example.com\/image.jpeg",
    "site": "http:\/\/myblog.com\/",
    "width": 300,
    "height": 400,
    "ratio": 0.75,
    "ip": "192.168.10.1",
    "updated_at": "2020-03-26 08:46:41",
    "created_at": "2020-03-26 08:46:41"
}

HTTP Request

POST images

Body Parameters

Parameter Type Status Description
user_id integer required exists:users,id. The id of the user. Unsigned integer.
url url required The url for the image.
site url optional The site the image is being displayed on.
width integer optional Image width in pixels.
height integer optional Image height in pixels.

Get Image


Requires authentication Fetches an image based on image id

Example request:

curl -X GET \
    -G "https://api.metapic.com/images/1?include_tags=1" 
const url = new URL(
    "https://api.metapic.com/images/1"
);

let params = {
    "include_tags": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

fetch(url, {
    method: "GET",
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "id": 1,
    "user_id": "{userId}",
    "url": "http:\/\/example.com\/image.jpeg",
    "site": "http:\/\/myblog.com\/",
    "width": 300,
    "height": 400,
    "ratio": 0.75,
    "ip": "192.168.10.1",
    "updated_at": "2020-03-26 08:46:41",
    "created_at": "2020-03-26 08:46:41"
}

HTTP Request

GET images/{image}

URL Parameters

Parameter Status Description
id required The ID of the image.

Query Parameters

Parameter Status Description
include_tags optional boolean. Whether to include the image tags in the request. Boolean.

Update Image


Requires authentication Updates a Metapic image. Returns the modified image as a json object.

Example request:

curl -X PUT \
    "https://api.metapic.com/images/1" \
    -H "Content-Type: application/json" \
    -d '{"url":"http:\/\/example.com\/image.jpeg","site":"http:\/\/myblog.com\/","width":123,"height":123}'
const url = new URL(
    "https://api.metapic.com/images/1"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "url": "http:\/\/example.com\/image.jpeg",
    "site": "http:\/\/myblog.com\/",
    "width": 123,
    "height": 123
}

fetch(url, {
    method: "PUT",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "id": 1,
    "user_id": "{userId}",
    "url": "http:\/\/example.com\/image.jpeg",
    "site": "http:\/\/myblog.com\/",
    "width": 300,
    "height": 400,
    "ratio": 0.75,
    "ip": "192.168.10.1",
    "updated_at": "2020-03-26 08:46:41",
    "created_at": "2020-03-26 08:46:41"
}

HTTP Request

PUT images/{image}

PATCH images/{image}

URL Parameters

Parameter Status Description
id required The ID of the image.

Body Parameters

Parameter Type Status Description
url url required The url for the image.
site url optional The site the image is being displayed on.
width integer optional Image width in pixels.
height integer optional Image height in pixels.

Delete Image

Deletes a Metapic image. Returns the deleted image as json object.


Requires authentication

Example request:

curl -X DELETE \
    "https://api.metapic.com/images/1" 
const url = new URL(
    "https://api.metapic.com/images/1"
);

fetch(url, {
    method: "DELETE",
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "id": 1,
    "user_id": "{userId}",
    "url": "http:\/\/example.com\/image.jpeg",
    "site": "http:\/\/myblog.com\/",
    "width": 300,
    "height": 400,
    "ratio": 0.75,
    "ip": "192.168.10.1",
    "updated_at": "2020-03-26 08:46:41",
    "created_at": "2020-03-26 08:46:41"
}

HTTP Request

DELETE images/{image}

URL Parameters

Parameter Status Description
id required The ID of the user.

Payment

Get list of all invoices.

Here you get a list of all invoices to this client. See Get Payment for invoice for getting more info about a invoice.


Requires authentication

Example request:

curl -X GET \
    -G "https://api.metapic.com/client/1/paymentsInvoice" 
const url = new URL(
    "https://api.metapic.com/client/1/paymentsInvoice"
);

fetch(url, {
    method: "GET",
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

[
    {
        "id": 123,
        "payment_date": "2020-07-01 00:00:00",
        "sent_to_partner_at": "2020-07-05 00:00:00",
        "updated_at": "2019-11-12 10:13:50",
        "created_at": "2019-11-12 10:13:50"
    },
    "..."
]

HTTP Request

GET client/{clientId}/paymentsInvoice

Get payments for last month.

Will give you all payments for last month. this is not final before 3 working days after last day of month before.


Requires authentication

Example request:

curl -X GET \
    -G "https://api.metapic.com/client/1/paymentsInvoice/lastMonth" 
const url = new URL(
    "https://api.metapic.com/client/1/paymentsInvoice/lastMonth"
);

fetch(url, {
    method: "GET",
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

[
    {
        "id": 132424,
        "user_id": 123,
        "email": "email@gmail.com",
        "user_earnings": 12345,
        "accepted_at": "2020-09-03 14:50:03",
        "client_earnings": 1235,
        "currency": "SEK",
        "user_earnings_formatted": "123.45 kr",
        "client_earnings_formatted": "12.35 kr"
    },
    "..."
]

HTTP Request

GET client/{clientId}/paymentsInvoice/lastMonth

Get payments for this month.

Will give you all payments for current month. this is not final before 3 working days after last day of month.


Requires authentication

Example request:

curl -X GET \
    -G "https://api.metapic.com/client/1/paymentsInvoice/thisMonth" 
const url = new URL(
    "https://api.metapic.com/client/1/paymentsInvoice/thisMonth"
);

fetch(url, {
    method: "GET",
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

[
    {
        "id": 132424,
        "user_id": 123,
        "email": "email@gmail.com",
        "user_earnings": 12345,
        "accepted_at": "2020-09-03 14:50:03",
        "client_earnings": 1235,
        "currency": "SEK",
        "user_earnings_formatted": "123.45 kr",
        "client_earnings_formatted": "12.35 kr"
    },
    "..."
]

HTTP Request

GET client/{clientId}/paymentsInvoice/thisMonth

Get all payments from a invoice.


Requires authentication

Example request:

curl -X GET \
    -G "https://api.metapic.com/client/1/paymentsInvoice/1" 
const url = new URL(
    "https://api.metapic.com/client/1/paymentsInvoice/1"
);

fetch(url, {
    method: "GET",
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

[
    {
        "id": 132424,
        "user_id": 123,
        "email": "email@gmail.com",
        "user_earnings": 12345,
        "accepted_at": "2020-09-03 14:50:03",
        "client_earnings": 1235,
        "currency": "SEK",
        "user_earnings_formatted": "123.45 kr",
        "client_earnings_formatted": "12.35 kr"
    },
    "..."
]

HTTP Request

GET client/{clientId}/paymentsInvoice/{invoiceId}

URL Parameters

Parameter Status Description
invoiceId required a invoice id you want to get payment from.

Social Media

Get Social Media


Requires authentication Returns all user's social media connected to your client account, sorted id in asc order.

Example request:

curl -X GET \
    -G "https://api.metapic.com/users/1/socialMedia" 
const url = new URL(
    "https://api.metapic.com/users/1/socialMedia"
);

fetch(url, {
    method: "GET",
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

[
    {
        "id": 3046,
        "user_id": "{userId}",
        "type": "youtube",
        "identifier": "sffsdfsdf123",
        "is_valid": 1,
        "created_at": "2019-06-24 10:39:39",
        "updated_at": "2020-03-27 09:15:45"
    },
    "..."
]

HTTP Request

GET users/{userId}/socialMedia

URL Parameters

Parameter Status Description
user_id required The ID of the user.

Create Social Media


Requires authentication Create a new social media for user. Return social media as a json object.

Example request:

curl -X POST \
    "https://api.metapic.com/users/1/socialMedia" \
    -H "Content-Type: application/json" \
    -d '{"type":"youtube","identifier":"my_instagram"}'
const url = new URL(
    "https://api.metapic.com/users/1/socialMedia"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "type": "youtube",
    "identifier": "my_instagram"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "id": 3046,
    "user_id": "{userId}",
    "type": "youtube",
    "identifier": "sffsdfsdf123",
    "is_valid": 1,
    "created_at": "2019-06-24 10:39:39",
    "updated_at": "2020-03-27 09:15:45"
}

HTTP Request

POST users/{userId}/socialMedia

URL Parameters

Parameter Status Description
user_id required The ID of the user.

Body Parameters

Parameter Type Status Description
type string required in:instagram,blog,website,youtube. Social Media type. Valid values are 'instagram', 'blog', 'website', 'youtube'.
identifier string required Social Media identifier.

Get Social Media by ID


Requires authentication Fetches social media based on social media id and user id.

Example request:

curl -X GET \
    -G "https://api.metapic.com/users/1/socialMedia/1" 
const url = new URL(
    "https://api.metapic.com/users/1/socialMedia/1"
);

fetch(url, {
    method: "GET",
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "id": 3046,
    "user_id": "{userId}",
    "type": "youtube",
    "identifier": "sffsdfsdf123",
    "is_valid": 1,
    "created_at": "2019-06-24 10:39:39",
    "updated_at": "2020-03-27 09:15:45"
}

HTTP Request

GET users/{userId}/socialMedia/{socialMedia}

URL Parameters

Parameter Status Description
user_id required The ID of the user.
social_media_id required The ID of user social media.

Update Social Media


Requires authentication Update user's social media. Return the modified social media as a json object.

Example request:

curl -X PUT \
    "https://api.metapic.com/users/1/socialMedia/1" \
    -H "Content-Type: application/json" \
    -d '{"type":"youtube","identifier":"my_instagram"}'
const url = new URL(
    "https://api.metapic.com/users/1/socialMedia/1"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "type": "youtube",
    "identifier": "my_instagram"
}

fetch(url, {
    method: "PUT",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "id": 3046,
    "user_id": "{userId}",
    "type": "youtube",
    "identifier": "sffsdfsdf123",
    "is_valid": 1,
    "created_at": "2019-06-24 10:39:39",
    "updated_at": "2020-03-27 09:15:45"
}

HTTP Request

PUT users/{userId}/socialMedia/{socialMedia}

PATCH users/{userId}/socialMedia/{socialMedia}

URL Parameters

Parameter Status Description
user_id required The ID of the user.
social_media_id required The ID of user social media.

Body Parameters

Parameter Type Status Description
type string required in:instagram,blog,website,youtube. Social Media type. Valid values are 'instagram', 'blog', 'website', 'youtube'.
identifier string required Social Media identifier.

Delete Social Media


Requires authentication Delete user's social media.

Example request:

curl -X DELETE \
    "https://api.metapic.com/users/1/socialMedia/1" 
const url = new URL(
    "https://api.metapic.com/users/1/socialMedia/1"
);

fetch(url, {
    method: "DELETE",
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "success": 1,
    "message": "social media id:1 removed"
}

HTTP Request

DELETE users/{userId}/socialMedia/{socialMedia}

URL Parameters

Parameter Status Description
user_id required The ID of the user.
social_media_id required The ID of user social media.

Users

Access Token


Requires authentication Get User Access Token

Example request:

curl -X GET \
    -G "https://api.metapic.com/users/1/access-token" 
const url = new URL(
    "https://api.metapic.com/users/1/access-token"
);

fetch(url, {
    method: "GET",
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "random_token": "$2y$10$GqXBc.ciJ0qSZQrBJ5X8h.yxsnHs3R8cU6F1MlhhvtfEQAL6Do6yc",
    "token": "$2y$10$GqXBc.ciJ0qSZQrBJ5X8h.yxsnHs3R8cU6F1MlhhvtfEQAL6Do6yc"
}

HTTP Request

GET users/{id}/access-token

URL Parameters

Parameter Status Description
id required The ID of the user.

User Config

Get User Config


Requires authentication

Example request:

curl -X GET \
    -G "https://api.metapic.com/users/1/user-config" 
const url = new URL(
    "https://api.metapic.com/users/1/user-config"
);

fetch(url, {
    method: "GET",
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "showedPopups": [
        "firstCollageItem",
        "linkTransform"
    ]
}

HTTP Request

GET users/{id}/user-config

URL Parameters

Parameter Status Description
id required The ID of the user.

Get Users


Requires authentication Returns all users connected to your client account, sorted on created date in descending order.

Example request:

curl -X GET \
    -G "https://api.metapic.com/users" 
const url = new URL(
    "https://api.metapic.com/users"
);

fetch(url, {
    method: "GET",
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

[
    {
        "id": 1,
        "created_at": "2018-11-17 22:24:28",
        "updated_at": "2018-11-19 14:42:38",
        "client_id": 2,
        "revenue_share": "0.00",
        "instagram_revenue_share": "0.00",
        "name": "{username}"
    },
    "..."
]

HTTP Request

GET users

Create User


Requires authentication Create a new Metapic user. The user will automatically be linked to your account.

Example request:

curl -X POST \
    "https://api.metapic.com/users" \
    -H "Content-Type: application/json" \
    -d '{"username":"testUser","email":"test@test.com","password":"123456"}'
const url = new URL(
    "https://api.metapic.com/users"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "username": "testUser",
    "email": "test@test.com",
    "password": "123456"
}

fetch(url, {
    method: "POST",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "id": "{userId}",
    "username": "{username}",
    "email": "{email}",
    "created_at": "2019-06-17 11:53:17",
    "updated_at": "2019-08-20 07:07:50",
    "admin": 1,
    "last_active": "0000-00-00 00:00:00",
    "first_name": "{userName}",
    "surname": "{userSurname}",
    "country": "{country}",
    "city": "{city}",
    "address": "{address}",
    "postcode": "{postcode}",
    "tier_pricing_type": "",
    "config": "{\"showedPopups\":[\"firstCollageItem\"]}",
    "sign_user_agreement": "2019-08-14 08:34:12",
    "revenue_tier_id": 105,
    "recruitment_utm": null,
    "is_suspended": false,
    "is_verified": false,
    "client": {
        "id": 2,
        "client_id": "{clientId}",
        "name": "{clientName}",
        "created_at": "2014-04-24 16:12:29",
        "updated_at": "2018-11-21 13:57:23",
        "own_paymentsystem": 0,
        "config": "{    \"tabs\": {        \"home\":{\"showMenu\":true},        \"find\":{\"showMenu\":true},\t\"collage\":{\"showMenu\":true},\t\"tagEditor\":{\"showMenu\":true},        \"stats\":{\"showMenu\":true},\t\"listLinks\":{\"showMenu\":true}    },    \"canLogin\": true}",
        "feed": "live_se",
        "locale": "SE",
        "revenue_model": "blog_percentage",
        "revenue_share": "0.00",
        "store_group_id": 1,
        "default_revenue_tier": 81,
        "default_verified_users": 0,
        "store_group": {
            "id": 1,
            "name": "Standard SE",
            "shopello": 1,
            "key": "se",
            "locale": "SE",
            "lang": "sv",
            "currency": "SEK",
            "es": 0,
            "payment_limit": 100000
        }
    },
    "revenue_tier": {
        "id": 76,
        "created_at": "2018-09-14 16:39:34",
        "updated_at": "2019-04-29 10:47:34",
        "client_id": 2,
        "revenue_share": "0.50",
        "instagram_revenue_share": "0.10",
        "name": "Silver"
    }
}

HTTP Request

POST users

Body Parameters

Parameter Type Status Description
username string optional The name of the user. Max 24 alphanumeric characters.
email email required email. Valid email address. Unique.
password string optional At least 6 characters.

Get User


Requires authentication Fetches a user based on user id.

Example request:

curl -X GET \
    -G "https://api.metapic.com/users/1" 
const url = new URL(
    "https://api.metapic.com/users/1"
);

fetch(url, {
    method: "GET",
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "id": "{userId}",
    "username": "{username}",
    "email": "{email}",
    "created_at": "2019-06-17 11:53:17",
    "updated_at": "2019-08-20 07:07:50",
    "admin": 1,
    "last_active": "0000-00-00 00:00:00",
    "first_name": "{userName}",
    "surname": "{userSurname}",
    "country": "{country}",
    "city": "{city}",
    "address": "{address}",
    "postcode": "{postcode}",
    "tier_pricing_type": "",
    "config": "{\"showedPopups\":[\"firstCollageItem\"]}",
    "sign_user_agreement": "2019-08-14 08:34:12",
    "revenue_tier_id": 105,
    "recruitment_utm": null,
    "is_suspended": false,
    "is_verified": false,
    "client": {
        "id": 2,
        "client_id": "{clientId}",
        "name": "{clientName}",
        "created_at": "2014-04-24 16:12:29",
        "updated_at": "2018-11-21 13:57:23",
        "own_paymentsystem": 0,
        "config": "{    \"tabs\": {        \"home\":{\"showMenu\":true},        \"find\":{\"showMenu\":true},\t\"collage\":{\"showMenu\":true},\t\"tagEditor\":{\"showMenu\":true},        \"stats\":{\"showMenu\":true},\t\"listLinks\":{\"showMenu\":true}    },    \"canLogin\": true}",
        "feed": "live_se",
        "locale": "SE",
        "revenue_model": "blog_percentage",
        "revenue_share": "0.00",
        "store_group_id": 1,
        "default_revenue_tier": 81,
        "default_verified_users": 0,
        "store_group": {
            "id": 1,
            "name": "Standard SE",
            "shopello": 1,
            "key": "se",
            "locale": "SE",
            "lang": "sv",
            "currency": "SEK",
            "es": 0,
            "payment_limit": 100000
        }
    },
    "revenue_tier": {
        "id": 76,
        "created_at": "2018-09-14 16:39:34",
        "updated_at": "2019-04-29 10:47:34",
        "client_id": 2,
        "revenue_share": "0.50",
        "instagram_revenue_share": "0.10",
        "name": "Silver"
    }
}

HTTP Request

GET users/{user}

URL Parameters

Parameter Status Description
id required The ID of the user.

Update User


Requires authentication Updates a Metapic user. Returns the modified user as a json object.

Example request:

curl -X PUT \
    "https://api.metapic.com/users/1" \
    -H "Content-Type: application/json" \
    -d '{"username":"testUser","email":"test@test.com","password":"123456"}'
const url = new URL(
    "https://api.metapic.com/users/1"
);

let headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
};

let body = {
    "username": "testUser",
    "email": "test@test.com",
    "password": "123456"
}

fetch(url, {
    method: "PUT",
    headers: headers,
    body: body
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "id": "{userId}",
    "username": "{username}",
    "email": "{email}",
    "created_at": "2019-06-17 11:53:17",
    "updated_at": "2019-08-20 07:07:50",
    "admin": 1,
    "last_active": "0000-00-00 00:00:00",
    "first_name": "{userName}",
    "surname": "{userSurname}",
    "country": "{country}",
    "city": "{city}",
    "address": "{address}",
    "postcode": "{postcode}",
    "tier_pricing_type": "",
    "config": "{\"showedPopups\":[\"firstCollageItem\"]}",
    "sign_user_agreement": "2019-08-14 08:34:12",
    "revenue_tier_id": 105,
    "recruitment_utm": null,
    "is_suspended": false,
    "is_verified": false,
    "client": {
        "id": 2,
        "client_id": "{clientId}",
        "name": "{clientName}",
        "created_at": "2014-04-24 16:12:29",
        "updated_at": "2018-11-21 13:57:23",
        "own_paymentsystem": 0,
        "config": "{    \"tabs\": {        \"home\":{\"showMenu\":true},        \"find\":{\"showMenu\":true},\t\"collage\":{\"showMenu\":true},\t\"tagEditor\":{\"showMenu\":true},        \"stats\":{\"showMenu\":true},\t\"listLinks\":{\"showMenu\":true}    },    \"canLogin\": true}",
        "feed": "live_se",
        "locale": "SE",
        "revenue_model": "blog_percentage",
        "revenue_share": "0.00",
        "store_group_id": 1,
        "default_revenue_tier": 81,
        "default_verified_users": 0,
        "store_group": {
            "id": 1,
            "name": "Standard SE",
            "shopello": 1,
            "key": "se",
            "locale": "SE",
            "lang": "sv",
            "currency": "SEK",
            "es": 0,
            "payment_limit": 100000
        }
    },
    "revenue_tier": {
        "id": 76,
        "created_at": "2018-09-14 16:39:34",
        "updated_at": "2019-04-29 10:47:34",
        "client_id": 2,
        "revenue_share": "0.50",
        "instagram_revenue_share": "0.10",
        "name": "Silver"
    }
}

HTTP Request

PUT users/{user}

PATCH users/{user}

URL Parameters

Parameter Status Description
id required The ID of the user.

Body Parameters

Parameter Type Status Description
username string optional The name of the user. Max 24 alphanumeric characters.
email email optional email. Valid email address. Unique.
password string optional At least 6 characters.

Delete User


Requires authentication Deletes a Metapic user. Returns the deleted user as json object.

Example request:

curl -X DELETE \
    "https://api.metapic.com/users/1?force=1" 
const url = new URL(
    "https://api.metapic.com/users/1"
);

let params = {
    "force": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

fetch(url, {
    method: "DELETE",
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "id": "{userId}",
    "username": "{username}",
    "email": "{email}",
    "created_at": "2019-06-17 11:53:17",
    "updated_at": "2019-08-20 07:07:50",
    "admin": 1,
    "last_active": "0000-00-00 00:00:00",
    "first_name": "{userName}",
    "surname": "{userSurname}",
    "country": "{country}",
    "city": "{city}",
    "address": "{address}",
    "postcode": "{postcode}",
    "tier_pricing_type": "",
    "config": "{\"showedPopups\":[\"firstCollageItem\"]}",
    "sign_user_agreement": "2019-08-14 08:34:12",
    "revenue_tier_id": 105,
    "recruitment_utm": null,
    "is_suspended": false,
    "is_verified": false,
    "client": {
        "id": 2,
        "client_id": "{clientId}",
        "name": "{clientName}",
        "created_at": "2014-04-24 16:12:29",
        "updated_at": "2018-11-21 13:57:23",
        "own_paymentsystem": 0,
        "config": "{    \"tabs\": {        \"home\":{\"showMenu\":true},        \"find\":{\"showMenu\":true},\t\"collage\":{\"showMenu\":true},\t\"tagEditor\":{\"showMenu\":true},        \"stats\":{\"showMenu\":true},\t\"listLinks\":{\"showMenu\":true}    },    \"canLogin\": true}",
        "feed": "live_se",
        "locale": "SE",
        "revenue_model": "blog_percentage",
        "revenue_share": "0.00",
        "store_group_id": 1,
        "default_revenue_tier": 81,
        "default_verified_users": 0,
        "store_group": {
            "id": 1,
            "name": "Standard SE",
            "shopello": 1,
            "key": "se",
            "locale": "SE",
            "lang": "sv",
            "currency": "SEK",
            "es": 0,
            "payment_limit": 100000
        }
    },
    "revenue_tier": {
        "id": 76,
        "created_at": "2018-09-14 16:39:34",
        "updated_at": "2019-04-29 10:47:34",
        "client_id": 2,
        "revenue_share": "0.50",
        "instagram_revenue_share": "0.10",
        "name": "Silver"
    }
}

HTTP Request

DELETE users/{user}

URL Parameters

Parameter Status Description
id required The ID of the user.

Query Parameters

Parameter Status Description
force optional integer. Force delete user.

general

Say Hello to World

Returns a hello message with the arguments that you send in


Requires authentication

Example request:

curl -X GET \
    -G "https://api.metapic.com/hello" 
const url = new URL(
    "https://api.metapic.com/hello"
);

fetch(url, {
    method: "GET",
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "message": "hello world",
    "input": {
        "access_token": "OYqOixgvEbxc9nnKiZCywzDkZHNpKRP8",
        "client_id": "591571223752267"
    }
}

HTTP Request

GET hello

Get Popular Tags


Requires authentication

Example request:

curl -X GET \
    -G "https://api.metapic.com/tags/popular/1?start_date=2019-01-01&end_date=2019-01-02" 
const url = new URL(
    "https://api.metapic.com/tags/popular/1"
);

let params = {
    "start_date": "2019-01-01",
    "end_date": "2019-01-02",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

fetch(url, {
    method: "GET",
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

[
    {
        "id": 2117511,
        "x": 0.342792,
        "y": 0.00717703,
        "width": 0.311956,
        "height": 0.98883,
        "meta_info": "{\"original_url\":\"https:\\\/\\\/www.ellos.no\\\/ellos-home\\\/sengeteppe-sanora-i-quiltet-floyel\\\/1535571-04\"}",
        "link": "http:\/\/example.com",
        "image_id": 473027,
        "text": "Grått sengeteppe HER",
        "type": "awin_NO",
        "created_at": "2020-03-23 21:25:42",
        "created_as": "tageditorDeeplinking",
        "url": "http:\/\/example.com",
        "total_clicks": 11
    },
    "..."
]

HTTP Request

GET tags/popular/{id}

URL Parameters

Parameter Status Description
user_id required The ID of the user.

Query Parameters

Parameter Status Description
start_date optional Date (Y-m-d). Date (Y-m-d).
end_date optional Date (Y-m-d). Date (Y-m-d).

Check Client


Requires authentication Returns client name

Example request:

curl -X POST \
    "https://api.metapic.com/clients/check" 
const url = new URL(
    "https://api.metapic.com/clients/check"
);

fetch(url, {
    method: "POST",
})
    .then(response => response.json())
    .then(json => console.log(json));

Example response (200):

{
    "status": 200,
    "name": "{clientName}"
}

HTTP Request

POST clients/check