MENU navbar-image

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:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/clicks/by-date/1';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'query' => [
            'from' => '2014-11-08 10:24',
            'to' => '2014-11-08 10:24',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
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
    }
}
 

Request      

GET clicks/by-date/{user_id?}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

user_id   integer  optional  

The id of the user to fetch clicks for. Example: 1

Query Parameters

from   string  optional  

Valid date|datetime format 2014-11-08 10:24 as string.

Must be a valid date. Example: 2014-11-08 10:24

to   string  optional  

Valid date|datetime format 2014-11-08 10:24 as string.

Must be a valid date. 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:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/clicks';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'query' => [
            'from' => '2014-11-08 10:24',
            'to' => '2014-11-08 10:24',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
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
    },
    "..."
]
 

Request      

GET clicks

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Query Parameters

from   string  optional  

Valid date|datetime format 2014-11-08 10:24 as string.

Must be a valid date. Example: 2014-11-08 10:24

to   string  optional  

Valid date|datetime format 2014-11-08 10:24 as string.

Must be a valid date. 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:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/clicks/1';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'query' => [
            'from' => '2014-11-08 10:24',
            'to' => '2014-11-08 10:24',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/clicks/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/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):


{
    "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
}
 

Request      

GET clicks/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

user_id   integer   

The id of the user to fetch clicks for. Example: 1

Query Parameters

from   string  optional  

Valid date|datetime format 2014-11-08 10:24 as string.

Must be a valid date. Example: 2014-11-08 10:24

to   string  optional  

Valid date|datetime format 2014-11-08 10:24 as string.

Must be a valid date. Example: 2014-11-08 10:24

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:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/deepLinkBlogPost/1';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'json' => [
            'blogPost' => '<div> <a href=\'https://na-kd.com\'> link</a></div>',
            'dry' => 1,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "https://api.metapic.com/deepLinkBlogPost/1" \
    --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/1"
);

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
}
 

Request      

POST deepLinkBlogPost/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

user_id   integer  optional  

The id of the user. Example: 1

Body Parameters

blogPost   string   

Link. Example: <div> <a href='https://na-kd.com'> link</a></div>

dry   boolean  optional  

When dry is set - link will not be created. Example: 1

requires authentication

Create deeplinks from an array of links

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/deep-links';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'json' => [
            'links' => '["https://ellos.com"]',
            'userId' => 1,
            'dry' => 1,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
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"
            }
        ]
    },
    "..."
]
 

Endpoints

Display a listing of the resource.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/stores/{store_id}/offers';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/v2/stores/{store_id}/offers" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/stores/{store_id}/offers"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "{token}",
};

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

Request      

GET v2/stores/{store_id}/offers

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Get the validation rules that apply to the request.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/stores/{store_id}/offers';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'json' => [
            'active' => false,
            'campaign_title' => 'uikqywm',
            'campaign_text' => 'hcyxmtddsuufg',
            'has_product_seeding' => true,
            'todo' => [
                'sunt',
            ],
            'has_onetime_payment' => false,
            'one_time_payment' => 8,
            'valid_from' => '2024-07-02T10:18:47',
            'valid_until' => '2089-02-08',
            'max_clicks' => 13,
            'per_user_limit' => true,
            'max_money' => 5,
            'type' => 'user_accept',
            'traffic_sources_costs' => [
                [
                    'source' => 20,
                    'cpc' => 14,
                    'cpa' => 0,
                ],
            ],
            'targets' => [
                'user_ids' => [
                    10,
                ],
                'user_tag_ids' => [
                    11,
                ],
                'store_group_ids' => [
                    9,
                ],
                'emails' => [
                    'klocko.schuyler@example.net',
                ],
                'social_media_identifiers' => [
                    't',
                ],
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "https://api.metapic.com/v2/stores/{store_id}/offers" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}" \
    --data "{
    \"active\": false,
    \"campaign_title\": \"uikqywm\",
    \"campaign_text\": \"hcyxmtddsuufg\",
    \"has_product_seeding\": true,
    \"todo\": [
        \"sunt\"
    ],
    \"has_onetime_payment\": false,
    \"one_time_payment\": 8,
    \"valid_from\": \"2024-07-02T10:18:47\",
    \"valid_until\": \"2089-02-08\",
    \"max_clicks\": 13,
    \"per_user_limit\": true,
    \"max_money\": 5,
    \"type\": \"user_accept\",
    \"traffic_sources_costs\": [
        {
            \"source\": 20,
            \"cpc\": 14,
            \"cpa\": 0
        }
    ],
    \"targets\": {
        \"user_ids\": [
            10
        ],
        \"user_tag_ids\": [
            11
        ],
        \"store_group_ids\": [
            9
        ],
        \"emails\": [
            \"klocko.schuyler@example.net\"
        ],
        \"social_media_identifiers\": [
            \"t\"
        ]
    }
}"
const url = new URL(
    "https://api.metapic.com/v2/stores/{store_id}/offers"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "{token}",
};

let body = {
    "active": false,
    "campaign_title": "uikqywm",
    "campaign_text": "hcyxmtddsuufg",
    "has_product_seeding": true,
    "todo": [
        "sunt"
    ],
    "has_onetime_payment": false,
    "one_time_payment": 8,
    "valid_from": "2024-07-02T10:18:47",
    "valid_until": "2089-02-08",
    "max_clicks": 13,
    "per_user_limit": true,
    "max_money": 5,
    "type": "user_accept",
    "traffic_sources_costs": [
        {
            "source": 20,
            "cpc": 14,
            "cpa": 0
        }
    ],
    "targets": {
        "user_ids": [
            10
        ],
        "user_tag_ids": [
            11
        ],
        "store_group_ids": [
            9
        ],
        "emails": [
            "klocko.schuyler@example.net"
        ],
        "social_media_identifiers": [
            "t"
        ]
    }
};

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

Request      

POST v2/stores/{store_id}/offers

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Body Parameters

active   boolean   

Example: false

campaign_title   string   

Must not be greater than 64 characters. Example: uikqywm

campaign_text   string  optional  

Must not be greater than 1056 characters. Example: hcyxmtddsuufg

has_product_seeding   boolean  optional  

Example: true

todo   string[]  optional  
has_onetime_payment   boolean  optional  

Example: false

one_time_payment   integer  optional  

This field is required when has_onetime_payment is true. Must not be greater than 1000000. Example: 8

valid_from   string  optional  

Must be a valid date. Example: 2024-07-02T10:18:47

valid_until   string  optional  

Must be a valid date. Must be a date after from. Example: 2089-02-08

max_clicks   integer  optional  

Must not be greater than 1000000. Example: 13

per_user_limit   boolean  optional  

Example: true

max_money   integer  optional  

Must not be greater than 1000000. Example: 5

type   string   

Example: user_accept

Must be one of:
  • standard
  • user_accept
  • store_accept
  • suggestion
traffic_sources_costs   object[]   
source   integer   

Example: 20

cpc   integer   

Must not be greater than 1000. Example: 14

cpa   number   

Must be between 0 and 1. Example: 0

targets   object   
user_ids   integer[]  optional  
user_tag_ids   integer[]  optional  
store_group_ids   integer[]  optional  
emails   string[]  optional  

The value format is invalid.

social_media_identifiers   string[]  optional  

Must not be greater than 30 characters.

Get the validation rules that apply to the request.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/offers/{id}';
$response = $client->put(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'json' => [
            'active' => false,
            'campaign_title' => 'eqcifnljmbt',
            'campaign_text' => 'mguttaawfgdiivzcmtot',
            'has_product_seeding' => true,
            'todo' => [
                'ab',
            ],
            'has_onetime_payment' => true,
            'one_time_payment' => 5,
            'valid_from' => '2024-07-02T10:18:47',
            'valid_until' => '2121-02-28',
            'max_clicks' => 20,
            'per_user_limit' => true,
            'max_money' => 7,
            'type' => 'suggestion',
            'traffic_sources_costs' => [
                [
                    'source' => 11,
                    'cpc' => 12,
                    'cpa' => 1,
                ],
            ],
            'targets' => [
                'user_ids' => [
                    19,
                ],
                'user_tag_ids' => [
                    19,
                ],
                'store_group_ids' => [
                    13,
                ],
                'emails' => [
                    'dickinson.ryder@example.com',
                ],
                'social_media_identifiers' => [
                    'ujjqlibrbyy',
                ],
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request PUT \
    "https://api.metapic.com/v2/offers/{id}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}" \
    --data "{
    \"active\": false,
    \"campaign_title\": \"eqcifnljmbt\",
    \"campaign_text\": \"mguttaawfgdiivzcmtot\",
    \"has_product_seeding\": true,
    \"todo\": [
        \"ab\"
    ],
    \"has_onetime_payment\": true,
    \"one_time_payment\": 5,
    \"valid_from\": \"2024-07-02T10:18:47\",
    \"valid_until\": \"2121-02-28\",
    \"max_clicks\": 20,
    \"per_user_limit\": true,
    \"max_money\": 7,
    \"type\": \"suggestion\",
    \"traffic_sources_costs\": [
        {
            \"source\": 11,
            \"cpc\": 12,
            \"cpa\": 1
        }
    ],
    \"targets\": {
        \"user_ids\": [
            19
        ],
        \"user_tag_ids\": [
            19
        ],
        \"store_group_ids\": [
            13
        ],
        \"emails\": [
            \"dickinson.ryder@example.com\"
        ],
        \"social_media_identifiers\": [
            \"ujjqlibrbyy\"
        ]
    }
}"
const url = new URL(
    "https://api.metapic.com/v2/offers/{id}"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "{token}",
};

let body = {
    "active": false,
    "campaign_title": "eqcifnljmbt",
    "campaign_text": "mguttaawfgdiivzcmtot",
    "has_product_seeding": true,
    "todo": [
        "ab"
    ],
    "has_onetime_payment": true,
    "one_time_payment": 5,
    "valid_from": "2024-07-02T10:18:47",
    "valid_until": "2121-02-28",
    "max_clicks": 20,
    "per_user_limit": true,
    "max_money": 7,
    "type": "suggestion",
    "traffic_sources_costs": [
        {
            "source": 11,
            "cpc": 12,
            "cpa": 1
        }
    ],
    "targets": {
        "user_ids": [
            19
        ],
        "user_tag_ids": [
            19
        ],
        "store_group_ids": [
            13
        ],
        "emails": [
            "dickinson.ryder@example.com"
        ],
        "social_media_identifiers": [
            "ujjqlibrbyy"
        ]
    }
};

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

Request      

PUT v2/offers/{id}

PATCH v2/offers/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Body Parameters

active   boolean   

Example: false

campaign_title   string   

Must not be greater than 64 characters. Example: eqcifnljmbt

campaign_text   string  optional  

Must not be greater than 1056 characters. Example: mguttaawfgdiivzcmtot

has_product_seeding   boolean  optional  

Example: true

todo   string[]  optional  
has_onetime_payment   boolean  optional  

Example: true

one_time_payment   integer  optional  

This field is required when has_onetime_payment is true. Must not be greater than 1000000. Example: 5

valid_from   string  optional  

Must be a valid date. Example: 2024-07-02T10:18:47

valid_until   string  optional  

Must be a valid date. Must be a date after from. Example: 2121-02-28

max_clicks   integer  optional  

Must not be greater than 1000000. Example: 20

per_user_limit   boolean  optional  

Example: true

max_money   integer  optional  

Must not be greater than 1000000. Example: 7

type   string   

Example: suggestion

Must be one of:
  • standard
  • user_accept
  • store_accept
  • suggestion
traffic_sources_costs   object[]   
source   integer   

Example: 11

cpc   integer   

Must not be greater than 1000. Example: 12

cpa   number   

Must be between 0 and 1. Example: 1

targets   object   
user_ids   integer[]  optional  
user_tag_ids   integer[]  optional  
store_group_ids   integer[]  optional  
emails   string[]  optional  

The value format is invalid.

social_media_identifiers   string[]  optional  

Must not be greater than 30 characters.

Remove the specified resource from storage.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/offers/{id}';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "https://api.metapic.com/v2/offers/{id}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/offers/{id}"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "{token}",
};

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

Request      

DELETE v2/offers/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Display a listing of the resource.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/offers/{offer_id}/targets';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/v2/offers/{offer_id}/targets" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/offers/{offer_id}/targets"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "{token}",
};

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

Request      

GET v2/offers/{offer_id}/targets

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Get the validation rules that apply to the request.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/offers/{offer_id}/targets';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'json' => [
            'user_ids' => [
                2,
            ],
            'user_tag_ids' => [
                7,
            ],
            'store_group_ids' => [
                10,
            ],
            'emails' => [
                'lonie86@example.net',
            ],
            'social_media_identifiers' => [
                'ymtfjkptna',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "https://api.metapic.com/v2/offers/{offer_id}/targets" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}" \
    --data "{
    \"user_ids\": [
        2
    ],
    \"user_tag_ids\": [
        7
    ],
    \"store_group_ids\": [
        10
    ],
    \"emails\": [
        \"lonie86@example.net\"
    ],
    \"social_media_identifiers\": [
        \"ymtfjkptna\"
    ]
}"
const url = new URL(
    "https://api.metapic.com/v2/offers/{offer_id}/targets"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "{token}",
};

let body = {
    "user_ids": [
        2
    ],
    "user_tag_ids": [
        7
    ],
    "store_group_ids": [
        10
    ],
    "emails": [
        "lonie86@example.net"
    ],
    "social_media_identifiers": [
        "ymtfjkptna"
    ]
};

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

Request      

POST v2/offers/{offer_id}/targets

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Body Parameters

user_ids   integer[]  optional  
user_tag_ids   integer[]  optional  
store_group_ids   integer[]  optional  
emails   string[]  optional  

The value format is invalid.

social_media_identifiers   string[]  optional  

Must not be greater than 30 characters.

Display the specified resource.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/offers/{offer_id}/targets/{id}';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/v2/offers/{offer_id}/targets/{id}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/offers/{offer_id}/targets/{id}"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "{token}",
};

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

Request      

GET v2/offers/{offer_id}/targets/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Update the specified resource in storage.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/offers/{offer_id}/targets/{id}';
$response = $client->put(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request PUT \
    "https://api.metapic.com/v2/offers/{offer_id}/targets/{id}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/offers/{offer_id}/targets/{id}"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "{token}",
};

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

Request      

PUT v2/offers/{offer_id}/targets/{id}

PATCH v2/offers/{offer_id}/targets/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Remove the specified resource from storage.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/offers/{offer_id}/targets/{id}';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "https://api.metapic.com/v2/offers/{offer_id}/targets/{id}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/offers/{offer_id}/targets/{id}"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "{token}",
};

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

Request      

DELETE v2/offers/{offer_id}/targets/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Get the validation rules that apply to the request.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/clients';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'query' => [
            'name' => 'mhozdkmcavmucvb',
            'store_group_id' => '19',
            'size' => '6',
            'sort_by' => 'et',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/v2/clients?name=mhozdkmcavmucvb&store_group_id=19&size=6&sort_by=et" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/clients"
);

const params = {
    "name": "mhozdkmcavmucvb",
    "store_group_id": "19",
    "size": "6",
    "sort_by": "et",
};
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());

Request      

GET v2/clients

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Query Parameters

name   string  optional  

Must not be greater than 255 characters. Example: mhozdkmcavmucvb

store_group_id   integer  optional  

Example: 19

size   integer  optional  

Must not be greater than 100. Example: 6

sort_by   string  optional  

Example: et

Store a newly created resource in storage.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/clients';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "https://api.metapic.com/v2/clients" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/clients"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "{token}",
};

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

Request      

POST v2/clients

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Display the specified resource.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/clients/{id}';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/v2/clients/{id}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/clients/{id}"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "{token}",
};

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

Request      

GET v2/clients/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Update the specified resource in storage.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/clients/{id}';
$response = $client->put(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request PUT \
    "https://api.metapic.com/v2/clients/{id}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/clients/{id}"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "{token}",
};

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

Request      

PUT v2/clients/{id}

PATCH v2/clients/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Remove the specified resource from storage.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/clients/{id}';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "https://api.metapic.com/v2/clients/{id}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/clients/{id}"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "{token}",
};

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

Request      

DELETE v2/clients/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Get the validation rules that apply to the request.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/users';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'query' => [
            'query' => 'kpiawouwboxjz',
            'client_id' => '10',
            'store_group_id' => '7',
            'size' => '6',
            'sort_by' => 'quos',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/v2/users?query=kpiawouwboxjz&client_id=10&store_group_id=7&size=6&sort_by=quos" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/users"
);

const params = {
    "query": "kpiawouwboxjz",
    "client_id": "10",
    "store_group_id": "7",
    "size": "6",
    "sort_by": "quos",
};
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());

Request      

GET v2/users

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Query Parameters

query   string  optional  

Must not be greater than 64 characters. Example: kpiawouwboxjz

client_id   integer  optional  

Example: 10

store_group_id   integer  optional  

Example: 7

size   integer  optional  

Must not be greater than 100. Example: 6

sort_by   string  optional  

Example: quos

Store a newly created resource in storage.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/users';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "https://api.metapic.com/v2/users" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/users"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "{token}",
};

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

Request      

POST v2/users

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Display the specified resource.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/users/{id}';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/v2/users/{id}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/users/{id}"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "{token}",
};

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

Request      

GET v2/users/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Update the specified resource in storage.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/users/{id}';
$response = $client->put(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request PUT \
    "https://api.metapic.com/v2/users/{id}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/users/{id}"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "{token}",
};

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

Request      

PUT v2/users/{id}

PATCH v2/users/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Remove the specified resource from storage.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/users/{id}';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "https://api.metapic.com/v2/users/{id}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/users/{id}"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "{token}",
};

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

Request      

DELETE v2/users/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Get the validation rules that apply to the request.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/stores';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'query' => [
            'query' => 'vkqtpbbscqcbvflj',
            'store_group_id' => '18',
            'size' => '11',
            'sort_by' => 'excepturi',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/v2/stores?query=vkqtpbbscqcbvflj&store_group_id=18&size=11&sort_by=excepturi" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/stores"
);

const params = {
    "query": "vkqtpbbscqcbvflj",
    "store_group_id": "18",
    "size": "11",
    "sort_by": "excepturi",
};
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());

Request      

GET v2/stores

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Query Parameters

query   string  optional  

Must not be greater than 255 characters. Example: vkqtpbbscqcbvflj

store_group_id   integer  optional  

Example: 18

size   integer  optional  

Must not be greater than 100. Example: 11

sort_by   string  optional  

Example: excepturi

Display the specified resource.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/stores/{id}';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/v2/stores/{id}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/stores/{id}"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "{token}",
};

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

Request      

GET v2/stores/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Update the specified resource in storage.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/stores/{id}';
$response = $client->put(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request PUT \
    "https://api.metapic.com/v2/stores/{id}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/stores/{id}"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "{token}",
};

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

Request      

PUT v2/stores/{id}

PATCH v2/stores/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Remove the specified resource from storage.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/stores/{id}';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "https://api.metapic.com/v2/stores/{id}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/stores/{id}"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "{token}",
};

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

Request      

DELETE v2/stores/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Get the validation rules that apply to the request.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/user-tags';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'query' => [
            'name' => 'rjnlnsvqerqlqtfqzt',
            'store_id' => '14',
            'size' => '11',
            'sort_by' => 'cupiditate',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/v2/user-tags?name=rjnlnsvqerqlqtfqzt&store_id=14&size=11&sort_by=cupiditate" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/user-tags"
);

const params = {
    "name": "rjnlnsvqerqlqtfqzt",
    "store_id": "14",
    "size": "11",
    "sort_by": "cupiditate",
};
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());

Request      

GET v2/user-tags

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Query Parameters

name   string  optional  

Must not be greater than 255 characters. Example: rjnlnsvqerqlqtfqzt

store_id   integer  optional  

Example: 14

access_levels   object  optional  
Must be one of:
  • 0
  • 1
  • 2
size   integer  optional  

Must not be greater than 100. Example: 11

sort_by   string  optional  

Example: cupiditate

Store a newly created resource in storage.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/user-tags';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "https://api.metapic.com/v2/user-tags" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/user-tags"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "{token}",
};

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

Request      

POST v2/user-tags

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Display the specified resource.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/user-tags/{id}';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/v2/user-tags/{id}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/user-tags/{id}"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "{token}",
};

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

Request      

GET v2/user-tags/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Update the specified resource in storage.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/user-tags/{id}';
$response = $client->put(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request PUT \
    "https://api.metapic.com/v2/user-tags/{id}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/user-tags/{id}"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "{token}",
};

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

Request      

PUT v2/user-tags/{id}

PATCH v2/user-tags/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Remove the specified resource from storage.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/user-tags/{id}';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "https://api.metapic.com/v2/user-tags/{id}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/user-tags/{id}"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "{token}",
};

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

Request      

DELETE v2/user-tags/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Say Hello to World

requires authentication

Returns a hello message with the arguments that you send in

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/hello';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
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"
    }
}
 

Request      

GET hello

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Get Client organization invoice payment Pdf

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/clients/{clientId}/invoices/{invoiceId}/pdf';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/clients/{clientId}/invoices/{invoiceId}/pdf" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/clients/{clientId}/invoices/{invoiceId}/pdf"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "{token}",
};

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

Request      

GET clients/{clientId}/invoices/{invoiceId}/pdf

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Get Client organization invoice payment excel

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/clients/{clientId}/invoices/{invoiceId}/excel';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/clients/{clientId}/invoices/{invoiceId}/excel" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/clients/{clientId}/invoices/{invoiceId}/excel"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "{token}",
};

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

Request      

GET clients/{clientId}/invoices/{invoiceId}/excel

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Check Agency

requires authentication

Returns agency name

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/clients/check';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
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());

Request      

POST clients/check

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Get user access token by email (only for default zezam client)

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/users/access-token/from-email';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'json' => [
            'email' => 'aut',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
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\": \"aut\"
}"
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": "aut"
};

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

Request      

POST users/access-token/from-email

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Body Parameters

email   string   

Example: aut

Get user access token by userId (only for default zezam client)

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/users/access-token/from-id';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'json' => [
            'userId' => 9,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
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\": 9
}"
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": 9
};

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

Request      

POST users/access-token/from-id

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Body Parameters

userId   integer   

Example: 9

PUT v2/stores/{store_id}/payment

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/stores/{store_id}/payment';
$response = $client->put(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request PUT \
    "https://api.metapic.com/v2/stores/{store_id}/payment" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/stores/{store_id}/payment"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "{token}",
};

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

Request      

PUT v2/stores/{store_id}/payment

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Entrypoint

App's entrypoint

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/entrypoint';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'query' => [
            'app' => 'agency',
            'store_id' => '7',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/v2/entrypoint?app=agency&store_id=7" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/entrypoint"
);

const params = {
    "app": "agency",
    "store_id": "7",
};
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());

Request      

GET v2/entrypoint

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Query Parameters

app   string   

Example: agency

Must be one of:
  • advertiser
  • admin
  • agency
  • creator
store_id   integer  optional  

This field is required when app is advertiser. Example: 7

Response

Response Fields

indicators   object   
HAS_CAMPAIGNS   Indicates if the advertiser has campaigns.   

Offer Comments V2

Add OfferUser comment

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/offer-users/1/comments';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'json' => [
            'comment' => 'lrgc',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "https://api.metapic.com/v2/offer-users/1/comments" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}" \
    --data "{
    \"comment\": \"lrgc\"
}"
const url = new URL(
    "https://api.metapic.com/v2/offer-users/1/comments"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "{token}",
};

let body = {
    "comment": "lrgc"
};

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

Example response (200):


{
    "id": 12,
    "user_id": 40185,
    "user_full_name": "Mark mark",
    "comment_text": "Test new 234",
    "created_at": "2024-04-24T13:03:41",
    "updated_at": "2024-04-24T13:03:41"
}
 

Request      

POST v2/offer-users/{offer_user_id}/comments

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

offer_user_id   string   

The ID of the offerUser. Example: 1

Body Parameters

comment   string   

Must not be greater than 15000 characters. Example: lrgc

Update OfferUser comment

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/offer-users/1/comments/1';
$response = $client->put(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'json' => [
            'comment' => 'wjxuoprqkohtjjtsosjjlkx',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request PUT \
    "https://api.metapic.com/v2/offer-users/1/comments/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}" \
    --data "{
    \"comment\": \"wjxuoprqkohtjjtsosjjlkx\"
}"
const url = new URL(
    "https://api.metapic.com/v2/offer-users/1/comments/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "{token}",
};

let body = {
    "comment": "wjxuoprqkohtjjtsosjjlkx"
};

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

Example response (200):


{
    "id": 12,
    "user_id": 40185,
    "user_full_name": "Mark mark",
    "comment_text": "Test new 234",
    "created_at": "2024-04-24T13:03:41",
    "updated_at": "2024-04-24T13:03:41"
}
 

Request      

PUT v2/offer-users/{offer_user_id}/comments/{id}

PATCH v2/offer-users/{offer_user_id}/comments/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

offer_user_id   string   

The ID of the offerUser. Example: 1

offer_comment_id   string   

The ID of the comment. Example: 1

Body Parameters

comment   string   

Must not be greater than 15000 characters. Example: wjxuoprqkohtjjtsosjjlkx

Delete OfferUser comment

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/offer-users/1/comments/1';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "https://api.metapic.com/v2/offer-users/1/comments/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/offer-users/1/comments/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "{token}",
};

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

Request      

DELETE v2/offer-users/{offer_user_id}/comments/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

offer_user_id   string   

The ID of the offerUser. Example: 1

offerCommentId   string   

The ID of the comment. Example: 1

Offer User Activity

Get the list of activities on OfferUser card

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/offer-users/{offerUser_id}/activities';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/v2/offer-users/{offerUser_id}/activities" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/offer-users/{offerUser_id}/activities"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "{token}",
};

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

Example response (200):


{
    "data": [
        {
            "type": "COMMENT",
            "actor_id": 34985,
            "actor_display_name": "@username",
            "comment_id": 1,
            "comment_text": "Qui delectus provident labore iusto aut ad aperiam. Vitae recusandae quis laborum culpa placeat animi quibusdam. Cum omnis quas velit rerum blanditiis voluptas modi provident.",
            "created_at": "2024-04-16T22:39:26"
        },
        {
            "type": "COMMENT",
            "actor_id": 40185,
            "actor_display_name": "Mark",
            "comment_id": 1,
            "comment_text": "Cum a maxime sit rem tenetur. Ad in quibusdam suscipit est eos aut. Ex eligendi necessitatibus tempora distinctio.",
            "created_at": "2024-04-16T22:39:26",
            "updated_at": "2024-04-16T22:39:26"
        },
        {
            "type": "DELETED_COMMENT",
            "created_at": "2024-04-16CEST22:15:41"
        },
        {
            "type": "STATUS_CHANGE",
            "actor_id": 40185,
            "actor_display_name": "Admin",
            "old_status": "suggestion",
            "new_status": "denied",
            "created_at": "2024-04-16T22:39:26"
        },
        {
            "type": "STATUS_CHANGE",
            "old_status": "applied",
            "new_status": "have_posted",
            "created_at": "2024-04-16T22:42:35"
        },
        {
            "type": "STATUS_CHANGE",
            "actor_id": 34985,
            "actor_display_name": "@username",
            "old_status": "applied",
            "new_status": "accepted",
            "created_at": "2024-04-16T22:44:59"
        }
    ],
    "links": {
        "first": "/v2/offer-users/48798908/activities?page=1",
        "last": "/v2/offer-users/48798908/activities?page=10",
        "prev": null,
        "next": "/v2/offer-users/48798908/activities?page=2"
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 10,
        "links": [],
        "path": "/v2/offer-users/48798908/activities",
        "per_page": 20,
        "to": 20,
        "total": 200
    }
}
 

Request      

GET v2/offer-users/{offerUser_id}/activities

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Response

Response Fields

type   string   

The type of the activity. Can be one of the following values:
- COMMENT
- DELETED_COMMENT
- STATUS_CHANGE

actor_id   integer   

Unique identifier of the user who initiated the activity.
Absent when the activity was caused by the system.

actor_display_name   string   

The name of the actor who initiated the activity.
In case of Creator contains username
In case of Admin or Advertiser contains the full name
Absent when the activity was caused by the system.

comment_id   integer   

Unique identifier of the comment.
Present when type is COMMENT

comment_text   string   

Contains the comment text.
Present when type is COMMENT

new_status   string   

New offerUser status
Present when type is STATUS_CHANGE

old_status   string   

Old offerUser status
Present when type is STATUS_CHANGE

created_at   string   

Indicates time at which the activity happened.

updated_at   string   

Time of last editing.
Present if comment was edited

Offers

Get offer

requires authentication

Return offer details.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/offers/{offer_id}';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/v2/offers/{offer_id}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/offers/{offer_id}"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "{token}",
};

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

Request      

GET v2/offers/{offer_id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Upload Offer Image (v2)

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/offers/{offer_id}/uploads';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'json' => [
            'default' => 'image.png',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "https://api.metapic.com/v2/offers/{offer_id}/uploads" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}" \
    --data "{
    \"default\": \"image.png\"
}"
const url = new URL(
    "https://api.metapic.com/v2/offers/{offer_id}/uploads"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "{token}",
};

let body = {
    "default": "image.png"
};

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

Request      

POST v2/offers/{offer_id}/uploads

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Body Parameters

default   string   

Offer image.

Must not be greater than 10240 characters. Example: image.png

Get offer

requires authentication

Return offer details.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/offer-by-token/{offer_token}';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/v2/offer-by-token/{offer_token}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/offer-by-token/{offer_token}"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "{token}",
};

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

Request      

GET v2/offer-by-token/{offer_token}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Offer Participants

Checks if user has been added to the offer.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/offers/{offer_id}/users/{id}';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/v2/offers/{offer_id}/users/{id}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/offers/{offer_id}/users/{id}"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "{token}",
};

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

Request      

GET v2/offers/{offer_id}/users/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

List participants in a campaign

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/offers/{offer_id}/participants';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'query' => [
            'query' => 'accusamus',
            'status' => 'suggestion',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/v2/offers/{offer_id}/participants?query=accusamus&status=suggestion" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/offers/{offer_id}/participants"
);

const params = {
    "query": "accusamus",
    "status": "suggestion",
};
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):


{
    "data": [
        {
            "id": null,
            "offer_id": null,
            "user_id": null,
            "display_name": null,
            "clicks": null,
            "status": null,
            "todo": null,
            "payment_amount": null
        },
        {
            "id": null,
            "offer_id": null,
            "user_id": null,
            "display_name": null,
            "clicks": null,
            "status": null,
            "todo": null,
            "payment_amount": null
        }
    ],
    "links": {
        "first": "/?page=1",
        "last": "/?page=1",
        "prev": null,
        "next": null
    },
    "meta": {
        "current_page": 1,
        "from": 1,
        "last_page": 1,
        "links": [
            {
                "url": null,
                "label": "&laquo; Previous",
                "active": false
            },
            {
                "url": "/?page=1",
                "label": "1",
                "active": true
            },
            {
                "url": null,
                "label": "Next &raquo;",
                "active": false
            }
        ],
        "path": "/",
        "per_page": 10,
        "to": 2,
        "total": 2
    }
}
 

Request      

GET v2/offers/{offer_id}/participants

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Query Parameters

query   string  optional  

Filters the results that contain a text match for this term. A match may happen on either:

  • social media identifier
  • email
  • user id
  • user's username
  • user tag

Partial matches are supported. For example, 'el' will match 'hello'.

Must not be greater than 128 characters. Example: accusamus

status   string  optional  

Example: suggestion

Must be one of:
  • open
  • applied
  • denied
  • accepted
  • store_denied
  • done
  • suggestion
  • second_prio
  • have_posted
  • have_received
  • product_sent

Response

Response Fields

offer_comments_count   The number of comments on this participation.   
id   integer   

The unique id of this participant

offer_id   integer   

The id of the offer for this participant

display_name   string   

The name of the participant

clicks   integer   

The number of clicks left for this participant

status   string   

The status of this campaign participant

Must be one of:
  • open
  • applied
  • denied
  • accepted
  • store_denied
  • done
  • suggestion
  • second_prio
  • have_posted
  • have_received
  • product_sent
pre_registered_email   string|null   

The email by which/if the participant was added to the campaign

pre_registered_identifier   string|null   

The social media identifier by which/if the participant was added to the campaign

todo   array|null   

List of todo items

user_id   int|null   

The id of the user, if Metapic user is linked to the participant

username   string|null   

The username of the user, if Metapic user is linked to the participant

avatar   string|null   

The image associated with the user through social media identifier

social_media   array|null   

List of user's social media, if available

tags   array|null   

List of user tags, if available

Store a newly created resource in storage.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/offers/{offer_id}/participants';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "https://api.metapic.com/v2/offers/{offer_id}/participants" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/offers/{offer_id}/participants"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "{token}",
};

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

Request      

POST v2/offers/{offer_id}/participants

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Get participant details

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/offers/{offer_id}/participants/{id}';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/v2/offers/{offer_id}/participants/{id}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/offers/{offer_id}/participants/{id}"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "{token}",
};

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

Example response (200):


{
    "id": null,
    "offer_id": null,
    "user_id": null,
    "display_name": null,
    "clicks": null,
    "status": null,
    "todo": null,
    "payment_amount": null
}
 

Request      

GET v2/offers/{offer_id}/participants/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Response

Response Fields

id   integer   

The unique id of this participant

offer_id   integer   

The id of the offer for this participant

display_name   string   

The name of the participant

clicks   integer   

The number of clicks left for this participant

status   string   

The status of this campaign participant

Must be one of:
  • open
  • applied
  • denied
  • accepted
  • store_denied
  • done
  • suggestion
  • second_prio
  • have_posted
  • have_received
  • product_sent
pre_registered_email   string|null   

The email by which/if the participant was added to the campaign

pre_registered_identifier   string|null   

The social media identifier by which/if the participant was added to the campaign

todo   array|null   

List of todo items

user_id   int|null   

The id of the user, if Metapic user is linked to the participant

username   string|null   

The username of the user, if Metapic user is linked to the participant

avatar   string|null   

The image associated with the user through social media identifier

social_media   array|null   

List of user's social media, if available

tags   array|null   

List of user tags, if available

Update the specified resource in storage.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/offers/{offer_id}/participants/{id}';
$response = $client->put(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request PUT \
    "https://api.metapic.com/v2/offers/{offer_id}/participants/{id}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/offers/{offer_id}/participants/{id}"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "{token}",
};

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

Request      

PUT v2/offers/{offer_id}/participants/{id}

PATCH v2/offers/{offer_id}/participants/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Remove the specified resource from storage.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/offers/{offer_id}/participants/{id}';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "https://api.metapic.com/v2/offers/{offer_id}/participants/{id}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/offers/{offer_id}/participants/{id}"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "{token}",
};

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

Request      

DELETE v2/offers/{offer_id}/participants/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Update participant status

requires authentication

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/offers/{offer_id}/participants/{participant_id}/update-status';
$response = $client->patch(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'json' => [
            'status' => 'second_prio',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request PATCH \
    "https://api.metapic.com/v2/offers/{offer_id}/participants/{participant_id}/update-status" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}" \
    --data "{
    \"status\": \"second_prio\"
}"
const url = new URL(
    "https://api.metapic.com/v2/offers/{offer_id}/participants/{participant_id}/update-status"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "{token}",
};

let body = {
    "status": "second_prio"
};

fetch(url, {
    method: "PATCH",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "id": null,
    "offer_id": null,
    "user_id": null,
    "display_name": null,
    "clicks": null,
    "status": null,
    "todo": null,
    "payment_amount": null
}
 

Example response (200):


{
    "id": "{id}",
    "offer_id": "{offerId}",
    "user_id": "{userId}",
    "clicks": 0,
    "status": "accepted",
    "created_at": "2021-05-25 13:02:06",
    "updated_at": "2021-05-27 11:21:23"
}
 

Request      

PATCH v2/offers/{offer_id}/participants/{participant_id}/update-status

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Body Parameters

status   string   

Example: second_prio

Must be one of:
  • open
  • applied
  • denied
  • accepted
  • store_denied
  • done
  • suggestion
  • second_prio
  • have_posted
  • have_received
  • product_sent

Response

Response Fields

id   integer   

The unique id of this participant

offer_id   integer   

The id of the offer for this participant

display_name   string   

The name of the participant

clicks   integer   

The number of clicks left for this participant

status   string   

The status of this campaign participant

Must be one of:
  • open
  • applied
  • denied
  • accepted
  • store_denied
  • done
  • suggestion
  • second_prio
  • have_posted
  • have_received
  • product_sent
pre_registered_email   string|null   

The email by which/if the participant was added to the campaign

pre_registered_identifier   string|null   

The social media identifier by which/if the participant was added to the campaign

todo   array|null   

List of todo items

user_id   int|null   

The id of the user, if Metapic user is linked to the participant

username   string|null   

The username of the user, if Metapic user is linked to the participant

avatar   string|null   

The image associated with the user through social media identifier

social_media   array|null   

List of user's social media, if available

tags   array|null   

List of user tags, if available

Checks if user has been added to the offer.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/offer-by-token/{offer_token}/users/{userId}';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/v2/offer-by-token/{offer_token}/users/{userId}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/offer-by-token/{offer_token}/users/{userId}"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "{token}",
};

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

Request      

GET v2/offer-by-token/{offer_token}/users/{userId}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Mark user as having joined the campaign

requires authentication

This can only be performed by the user themselves.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/offer-by-token/{offer_token}/users/{user_id}/join';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "https://api.metapic.com/v2/offer-by-token/{offer_token}/users/{user_id}/join" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/v2/offer-by-token/{offer_token}/users/{user_id}/join"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "{token}",
};

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

Request      

POST v2/offer-by-token/{offer_token}/users/{user_id}/join

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

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:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/client/{clientId}/paymentsInvoice';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/client/{clientId}/paymentsInvoice" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/client/{clientId}/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"
    },
    "..."
]
 

Request      

GET client/{clientId}/paymentsInvoice

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

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:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/client/{clientId}/paymentsInvoice/lastMonth';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/client/{clientId}/paymentsInvoice/lastMonth" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/client/{clientId}/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@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"
    },
    "..."
]
 

Request      

GET client/{clientId}/paymentsInvoice/lastMonth

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

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:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/client/{clientId}/paymentsInvoice/thisMonth';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/client/{clientId}/paymentsInvoice/thisMonth" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/client/{clientId}/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@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"
    },
    "..."
]
 

Request      

GET client/{clientId}/paymentsInvoice/thisMonth

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

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:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/users/1/socialMedia';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/users/1/socialMedia" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/users/1/socialMedia"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "{token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.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"
    },
    "..."
]
 

Request      

GET users/{userId}/socialMedia

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

user_id   integer   

The ID of the user. Example: 1

Create Social Media

requires authentication

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

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/users/1/socialMedia';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'json' => [
            'type' => 'youtube',
            'identifier' => 'my_instagram',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "https://api.metapic.com/users/1/socialMedia" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}" \
    --data "{
    \"type\": \"youtube\",
    \"identifier\": \"my_instagram\"
}"
const url = new URL(
    "https://api.metapic.com/users/1/socialMedia"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "{token}",
};

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

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.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"
}
 

Request      

POST users/{userId}/socialMedia

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

user_id   integer   

The ID of the user. Example: 1

Body Parameters

type   string   

Social Media type. Valid values are 'instagram', 'blog', 'website', 'youtube', 'tiktok', 'pintrest', 'snapchat', 'onbaz', 'zezam'. Example: youtube

Must be one of:
  • instagram
  • blog
  • website
  • youtube
  • tiktok
  • pinterest
  • zezam
  • onbaz
  • snapchat
  • facebook
  • discord
  • linkedin
  • patreon
  • telegram
  • twitter
  • vimeo
  • whatsapp
  • tumblr
identifier   string   

Social Media identifier. Example: my_instagram

Get Social Media by ID

requires authentication

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

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/users/1/socialMedia/1';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request GET \
    --get "https://api.metapic.com/users/1/socialMedia/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/users/1/socialMedia/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": 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"
}
 

Request      

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

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

user_id   integer   

The ID of the user. Example: 1

social_media_id   integer   

The ID of user social media. Example: 1

Update Social Media

requires authentication

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

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/users/1/socialMedia/1';
$response = $client->put(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'json' => [
            'type' => 'youtube',
            'identifier' => 'my_instagram',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request PUT \
    "https://api.metapic.com/users/1/socialMedia/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}" \
    --data "{
    \"type\": \"youtube\",
    \"identifier\": \"my_instagram\"
}"
const url = new URL(
    "https://api.metapic.com/users/1/socialMedia/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "{token}",
};

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

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.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"
}
 

Request      

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

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

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

user_id   integer   

The ID of the user. Example: 1

social_media_id   integer   

The ID of user social media. Example: 1

Body Parameters

type   string   

Social Media type. Valid values are 'instagram', 'blog', 'website', 'youtube'. Example: youtube

Must be one of:
  • instagram
  • blog
  • website
  • youtube
  • tiktok
  • pinterest
  • zezam
  • onbaz
  • snapchat
  • facebook
  • discord
  • linkedin
  • patreon
  • telegram
  • twitter
  • vimeo
  • whatsapp
  • tumblr
identifier   string   

Social Media identifier. Example: my_instagram

Delete Social Media

requires authentication

Delete user's social media.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/users/1/socialMedia/1';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "https://api.metapic.com/users/1/socialMedia/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}"
const url = new URL(
    "https://api.metapic.com/users/1/socialMedia/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "{token}",
};

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

Request      

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

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

user_id   integer   

The ID of the user. Example: 1

social_media_id   integer   

The ID of user social media. Example: 1

Store

Create Store

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/v2/stores';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'json' => [
            'name' => 'accusamus',
            'domains' => [
                'https://lrB.LP-/  /',
            ],
            'categories' => [
                1,
            ],
            'logo_url' => 'http://www.grady.com/',
            'country' => 'SE',
            'currency' => 'EUR',
            'language' => 'saepe',
            'billing' => [
                'company_name' => 'ullam',
                'street' => 'omnis',
                'postal_code' => 'possimus',
                'city' => 'sed',
                'vat_number' => 'non',
            ],
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "https://api.metapic.com/v2/stores" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}" \
    --data "{
    \"name\": \"accusamus\",
    \"domains\": [
        \"https:\\/\\/lrB.LP-\\/  \\/\"
    ],
    \"categories\": [
        1
    ],
    \"logo_url\": \"http:\\/\\/www.grady.com\\/\",
    \"country\": \"SE\",
    \"currency\": \"EUR\",
    \"language\": \"saepe\",
    \"billing\": {
        \"company_name\": \"ullam\",
        \"street\": \"omnis\",
        \"postal_code\": \"possimus\",
        \"city\": \"sed\",
        \"vat_number\": \"non\"
    }
}"
const url = new URL(
    "https://api.metapic.com/v2/stores"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "{token}",
};

let body = {
    "name": "accusamus",
    "domains": [
        "https:\/\/lrB.LP-\/  \/"
    ],
    "categories": [
        1
    ],
    "logo_url": "http:\/\/www.grady.com\/",
    "country": "SE",
    "currency": "EUR",
    "language": "saepe",
    "billing": {
        "company_name": "ullam",
        "street": "omnis",
        "postal_code": "possimus",
        "city": "sed",
        "vat_number": "non"
    }
};

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

Request      

POST v2/stores

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Body Parameters

name   string   

Example: accusamus

domains   string[]  optional  

Store domains.

Must match the regex /^(https?:\/\/)?([\dA-Za-z.-]+).([A-Za-z.]{2,6})([\/\w .-])\/?$/.

categories   string[]  optional  

Store categories IDs.

logo_url   string   

the logo url Example: http://www.grady.com/

country   string   

Store locale. Example: SE

currency   string   

Store ISO currency code. Example: EUR

language   string  optional  

Example: saepe

billing   object  optional  
company_name   string   

Example: ullam

street   string   

Example: omnis

postal_code   string   

Example: possimus

city   string   

Example: sed

vat_number   string  optional  

Example: non

Users

Access Token

requires authentication

Get User Access Token

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/users/1/access-token';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
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"
}
 

Request      

GET users/{id}/access-token

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

id   integer   

The ID of the user. Example: 1

User Config

requires authentication

Get User Config

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/users/1/user-config';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
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"
    ]
}
 

Request      

GET users/{id}/user-config

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

id   integer   

The ID of the user. Example: 1

GDPR Delete User

requires authentication

Delete user according to GDPR standards

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/users/1/gdpr-delete';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
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
}
 

Request      

DELETE users/{id}/gdpr-delete

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

id   integer   

The ID of the user. Example: 1

Get Users

requires authentication

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

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/users';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
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}"
    },
    "..."
]
 

Request      

GET users

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Create User

requires authentication

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

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/users';
$response = $client->post(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'json' => [
            'email' => 'test@test.com',
            'username' => 'testUser',
            'password' => '123456',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request POST \
    "https://api.metapic.com/users" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}" \
    --data "{
    \"email\": \"test@test.com\",
    \"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": "test@test.com",
    "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"
    }
}
 

Request      

POST users

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

Body Parameters

email   string   

Valid email address. Unique.

The value format is invalid. Example: test@test.com

username   string  optional  

The name of the user. Max 24 alphanumeric characters. Example: testUser

password   string  optional  

At least 6 characters. Example: 123456

Get User

requires authentication

Fetches a user based on user id.

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/users/1';
$response = $client->get(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
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"
    }
}
 

Request      

GET users/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

id   integer   

The ID of the user. Example: 1

Update User

requires authentication

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

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/users/1';
$response = $client->put(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'json' => [
            'email' => 'test@test.com',
            'username' => 'testUser',
            'password' => '123456',
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request PUT \
    "https://api.metapic.com/users/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}" \
    --data "{
    \"email\": \"test@test.com\",
    \"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": "test@test.com",
    "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"
    }
}
 

Request      

PUT users/{id}

PATCH users/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

id   integer   

The ID of the user. Example: 1

Body Parameters

email   string  optional  

Valid email address. Unique.

The value format is invalid. Example: test@test.com

username   string  optional  

The name of the user. Max 24 alphanumeric characters. Example: testUser

password   string  optional  

At least 6 characters. Example: 123456

Delete User

requires authentication

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

Example request:
$client = new \GuzzleHttp\Client();
$url = 'https://api.metapic.com/users/1';
$response = $client->delete(
    $url,
    [
        'headers' => [
            'Content-Type' => 'application/json',
            'Accept' => 'application/json',
            'Authorization' => '{token}',
        ],
        'json' => [
            'force' => 9,
        ],
    ]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
curl --request DELETE \
    "https://api.metapic.com/users/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: {token}" \
    --data "{
    \"force\": 9
}"
const url = new URL(
    "https://api.metapic.com/users/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "{token}",
};

let body = {
    "force": 9
};

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"
    }
}
 

Request      

DELETE users/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: {token}

URL Parameters

id   integer   

The ID of the user. Example: 1

Body Parameters

force   integer  optional  

Example: 9