Introduction
This documentation aims to provide all the information you need to work with our API.
Authenticating requests
This API is not authenticated.
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 --request GET \
--get "https://api.metapic.com/clicks/by-date/1?from=2014-11-08+10%3A24&to=2014-11-08+10%3A24" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/clicks/by-date/1"
);
const params = {
"from": "2014-11-08 10:24",
"to": "2014-11-08 10:24",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
{
"{userEmail}": {
"day": [
{
"date": "2020-02-17",
"link_clicks": 262,
"tag_clicks": 0,
"user_id": 838,
"email": "{userEmail}"
},
"..."
],
"total": 58687
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get Clicks
requires authentication
Return the number of clicks. Between the from and to dates if not given for today.
Example request:
curl --request GET \
--get "https://api.metapic.com/clicks?from=2014-11-08+10%3A24&to=2014-11-08+10%3A24" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/clicks"
);
const params = {
"from": "2014-11-08 10:24",
"to": "2014-11-08 10:24",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.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
},
"..."
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
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 --request GET \
--get "https://api.metapic.com/clicks/voluptatem?from=2014-11-08+10%3A24&to=2014-11-08+10%3A24" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/clicks/voluptatem"
);
const params = {
"from": "2014-11-08 10:24",
"to": "2014-11-08 10:24",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.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
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Deep linking
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 --request POST \
"https://api.metapic.com/deepLinkBlogPost/omnis" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}" \
--data "{
\"blogPost\": \"<div> <a href=\'https:\\/\\/na-kd.com\'> link<\\/a><\\/div>\",
\"dry\": 1
}"
const url = new URL(
"https://api.metapic.com/deepLinkBlogPost/omnis"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
let body = {
"blogPost": "<div> <a href='https:\/\/na-kd.com'> link<\/a><\/div>",
"dry": 1
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.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": "{storeId}",
"type": "tradedoubler_SE",
"after": "https://c.mtpc.se/tags/link/2082970",
"currency": "SEK",
"tag_id": "{tagId}",
"user_revenue_cpc": 250,
"user_instagram_cpc": 100,
"user_revenue_cpa": 0,
"user_instagram_cpa": 0,
"user_revenue_cpc_formated": "2.50 kr",
"user_instagram_cpc_formated": "1.00 kr",
"traffic_sources_costs": [
{
"id": 301,
"store_id": "{storeId}",
"source": 0,
"cpc": 250,
"invoice_cpc": 250,
"cpa": 0,
"invoice_cpa": null,
"created_at": "2023-05-03 12:01:08",
"updated_at": "2023-05-03 12:01:08",
"user_revenue": 1,
"client_revenue": null,
"cpc_formatted": "2.50 kr",
"title": "General"
},
{
"id": 302,
"store_id": "{storeId}",
"source": 1,
"cpc": 100,
"invoice_cpc": 100,
"cpa": null,
"invoice_cpa": null,
"created_at": "2023-05-03 12:01:09",
"updated_at": "2023-05-03 12:01:09",
"user_revenue": 1,
"client_revenue": null,
"cpc_formatted": "1.00 kr",
"title": "Instagram"
}
]
}
],
"isUpdated": true
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create Deep Links
requires authentication
Create deeplinks from an array of links
Example request:
curl --request POST \
"https://api.metapic.com/deep-links" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}" \
--data "{
\"links\": \"[\\\"https:\\/\\/ellos.com\\\"]\",
\"userId\": 1,
\"dry\": 1
}"
const url = new URL(
"https://api.metapic.com/deep-links"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
let body = {
"links": "[\"https:\/\/ellos.com\"]",
"userId": 1,
"dry": 1
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.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": 250,
"user_instagram_cpc": 100,
"user_revenue_cpa": 0,
"user_instagram_cpa": 0,
"user_revenue_cpc_formated": "2.50 kr",
"user_instagram_cpc_formated": "1.00 kr",
"traffic_sources_costs": [
{
"id": 301,
"store_id": "{storeId}",
"source": 0,
"cpc": 250,
"invoice_cpc": 250,
"cpa": 0,
"invoice_cpa": null,
"created_at": "2023-05-03 12:01:08",
"updated_at": "2023-05-03 12:01:08",
"user_revenue": 1,
"client_revenue": null,
"cpc_formatted": "2.50 kr",
"title": "General"
},
{
"id": 302,
"store_id": "{storeId}",
"source": 1,
"cpc": 100,
"invoice_cpc": 100,
"cpa": null,
"invoice_cpa": null,
"created_at": "2023-05-03 12:01:09",
"updated_at": "2023-05-03 12:01:09",
"user_revenue": 1,
"client_revenue": null,
"cpc_formatted": "1.00 kr",
"title": "Instagram"
}
]
},
"..."
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Endpoints
Say Hello to World
requires authentication
Returns a hello message with the arguments that you send in
Example request:
curl --request GET \
--get "https://api.metapic.com/hello" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/hello"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
{
"message": "hello world",
"input": {
"access_token": "OYqOixgvEbxc9nnKiZCywzDkZHNpKRP8",
"client_id": "591571223752267"
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get Client organization invoice payment Pdf
Example request:
curl --request GET \
--get "https://api.metapic.com/clients/2/invoices/et/pdf" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/clients/2/invoices/et/pdf"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get Client organization invoice payment excel
Example request:
curl --request GET \
--get "https://api.metapic.com/clients/2/invoices/nihil/excel" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/clients/2/invoices/nihil/excel"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get Popular Tags
requires authentication
Check Agency
requires authentication
Returns agency name
Example request:
curl --request POST \
"https://api.metapic.com/clients/check" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/clients/check"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "POST",
headers,
}).then(response => response.json());
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get user access token by email (only for default zezam client)
Example request:
curl --request POST \
"https://api.metapic.com/users/access-token/from-email" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}" \
--data "{
\"email\": \"occaecati\"
}"
const url = new URL(
"https://api.metapic.com/users/access-token/from-email"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
let body = {
"email": "occaecati"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get user access token by userId (only for default zezam client)
Example request:
curl --request POST \
"https://api.metapic.com/users/access-token/from-id" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}" \
--data "{
\"userId\": 11
}"
const url = new URL(
"https://api.metapic.com/users/access-token/from-id"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
let body = {
"userId": 11
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Payment
Get list of all invoices.
requires authentication
Here you get a list of all invoices to this client. See Get Payment for invoice for getting more info about a invoice.
Example request:
curl --request GET \
--get "https://api.metapic.com/client/2/paymentsInvoice" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/client/2/paymentsInvoice"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.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"
},
"..."
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get payments for last month
requires authentication
Will give you all payments for last month. this is not final before 3 working days after last day of month before.
Example request:
curl --request GET \
--get "https://api.metapic.com/client/2/paymentsInvoice/lastMonth" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/client/2/paymentsInvoice/lastMonth"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
[
{
"id": 132424,
"user_id": 123,
"email": "[email protected]",
"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"
},
"..."
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get payments for this month
requires authentication
Will give you all payments for current month. this is not final before 3 working days after last day of month.
Example request:
curl --request GET \
--get "https://api.metapic.com/client/2/paymentsInvoice/thisMonth" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/client/2/paymentsInvoice/thisMonth"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
[
{
"id": 132424,
"user_id": 123,
"email": "[email protected]",
"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"
},
"..."
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Social Media
Get Social Media
requires authentication
Returns all user's social media connected to your client account, sorted id in asc order.
Create Social Media
requires authentication
Create a new social media for user. Return social media as a json object.
Get Social Media by ID
requires authentication
Fetches social media based on social media id and user id.
Update Social Media
requires authentication
Update user's social media. Return the modified social media as a json object.
Delete Social Media
requires authentication
Delete user's social media.
Users
Access Token
requires authentication
Get User Access Token
Example request:
curl --request GET \
--get "https://api.metapic.com/users/1/access-token" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/users/1/access-token"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
{
"random_token": "$2y$10$GqXBc.ciJ0qSZQrBJ5X8h.yxsnHs3R8cU6F1MlhhvtfEQAL6Do6yc",
"token": "$2y$10$GqXBc.ciJ0qSZQrBJ5X8h.yxsnHs3R8cU6F1MlhhvtfEQAL6Do6yc"
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
User Config
requires authentication
Get User Config
Example request:
curl --request GET \
--get "https://api.metapic.com/users/1/user-config" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/users/1/user-config"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
{
"showedPopups": [
"firstCollageItem",
"linkTransform"
]
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
GDPR Delete User
requires authentication
Delete user according to GDPR standards
Example request:
curl --request DELETE \
"https://api.metapic.com/users/1/gdpr-delete" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/users/1/gdpr-delete"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "DELETE",
headers,
}).then(response => response.json());
Example response (200):
{
"id": "{userId}",
"username": "",
"email": "",
"phone": "",
"created_at": "2021-11-10 12:04:16",
"updated_at": "2022-08-25 10:34:45",
"admin": 0,
"last_active": "0000-00-00 00:00:00",
"first_name": "",
"surname": "",
"vat_no": "",
"country": "",
"city": "",
"address": "",
"postcode": "",
"tier_pricing_type": "",
"config": null,
"sign_user_agreement": null,
"revenue_tier_id": "{revenue_tier_id}",
"recruitment_utm": null,
"is_suspended": false,
"is_verified": true
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get Users
requires authentication
Returns all users connected to your client account, sorted on created date in descending order.
Example request:
curl --request GET \
--get "https://api.metapic.com/users" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/users"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.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}"
},
"..."
]
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Create User
requires authentication
Create a new Metapic user. The user will automatically be linked to your account.
Example request:
curl --request POST \
"https://api.metapic.com/users" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}" \
--data "{
\"email\": \"[email protected]\",
\"username\": \"testUser\",
\"password\": \"123456\"
}"
const url = new URL(
"https://api.metapic.com/users"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
let body = {
"email": "[email protected]",
"username": "testUser",
"password": "123456"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.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"
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Get User
requires authentication
Fetches a user based on user id.
Example request:
curl --request GET \
--get "https://api.metapic.com/users/1" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}"
const url = new URL(
"https://api.metapic.com/users/1"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.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"
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Update User
requires authentication
Updates a Metapic user. Returns the modified user as a json object.
Example request:
curl --request PUT \
"https://api.metapic.com/users/1" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}" \
--data "{
\"email\": \"[email protected]\",
\"username\": \"testUser\",
\"password\": \"123456\"
}"
const url = new URL(
"https://api.metapic.com/users/1"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
let body = {
"email": "[email protected]",
"username": "testUser",
"password": "123456"
};
fetch(url, {
method: "PUT",
headers,
body: JSON.stringify(body),
}).then(response => response.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"
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.
Delete User
requires authentication
Deletes a Metapic user. Returns the deleted user as json object.
Example request:
curl --request DELETE \
"https://api.metapic.com/users/1" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--header "Authorization: {token}" \
--data "{
\"force\": 8
}"
const url = new URL(
"https://api.metapic.com/users/1"
);
const headers = {
"Content-Type": "application/json",
"Accept": "application/json",
"Authorization": "{token}",
};
let body = {
"force": 8
};
fetch(url, {
method: "DELETE",
headers,
body: JSON.stringify(body),
}).then(response => response.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"
}
}
Received response:
Request failed with error:
Tip: Check that you're properly connected to the network.
If you're a maintainer of ths API, verify that your API is running and you've enabled CORS.
You can check the Dev Tools console for debugging information.