Demo Code

Post

1
<?php
2
3
$request = new HttpRequest();
4
$request->setUrl('http://oltest1.api.offerslook.com/v1/offers');
5
$request->setMethod(HTTP_METH_POST);
6
7
$request->setHeaders(array(
8
'postman-token' => 'e74fa976-c532-0118-32da-1a9f1e8c90ce',
9
'cache-control' => 'no-cache',
10
'authorization' => 'Basic b2x0ZXN0MTo1YzVjZTZiMTZiMGE0NDNkOTg0ZDYyMjZlOTZkZGMzOQ==',
11
'content-type' => 'application/json'
12
));
13
14
$request->setBody('{
15
"offer": {
16
"adult_allowed": 0,
17
"advertiser_id": 5556,
18
"description": "This is our company's website address: http://www.offerslook.com.Welcome to visit!",
19
"destination_url": "https://oltest1.offerstrack.net/pixelBack.php?offer_id=19943&adv_id=5556&amount=100" ,
20
21
"incent_allowed": 0,
22
"name": "000-wyqirx",
23
"offer_approval": 1,
24
"preview_url": "http://www.offerslook.com",
25
"push_allowed": 0,
26
"revenue_type": "RPA+RPS",
27
"revenue": "5",
28
"percent_revenue": "10.00",
29
"payout_type": "CPA",
30
"payout": "2",
31
"status": "active",
32
"redirect_offer_id": 19921,
33
"global_redirect_enabled": 0,
34
"currency": "USD",
35
"conversion_protocol": "1",
36
"is_ssl": "0",
37
"approve_conversions": "0"
38
},
39
"offer_platform": {
40
"target": [
41
{
42
"platform": "Mobile",
43
"system": "iOS",
44
"is_above":1,
45
"version": [
46
"5.1",
47
"6.0",
48
"6.1"
49
]
50
},
51
{
52
"platform": "Mobile",
53
"system": "Android",
54
"version": []
55
56
},
57
{
58
"platform": "PC",
59
"system": null,
60
"version": null
61
}
Copied!

Put

1
<?php
2
3
$request = new HttpRequest();
4
$request->setUrl('http://oltest1.api.offerslook.com/v1/offers/54905');
5
$request->setMethod(HTTP_METH_PUT);
6
7
$request->setHeaders(array(
8
'postman-token' => '4eeb8570-f3a9-dde0-1c23-dc02e303e857',
9
'cache-control' => 'no-cache',
10
'authorization' => 'Basic b2x0ZXN0MTo1YzVjZTZiMTZiMGE0NDNkOTg0ZDYyMjZlOTZkZGMzOQ==',
11
'content-type' => 'application/json'
12
));
13
14
$request->setBody('{
15
"offer": {
16
"name":"rrrrrwrwr",
17
"adult_allowed": 0,
18
"advertiser_id": 5556,
19
"description": "This is our company's website address: http://www.offerslook.com.Welcome to visit!",
20
"destination_url": "https://oltest1.offerstrack.net/pixelBack.php?offer_id=19943&adv_id=5556&amount=100" ,
21
"end_date": 1577808000,
22
"incent_allowed": 0,
23
"offer_approval": 1,
24
"preview_url": "http://www.offerslook.com",
25
"push_allowed": 0,
26
"revenue_type": "RPA+RPS",
27
"revenue": "5.55",
28
"percent_revenue": "10.00",
29
"payout_type": "CPI",
30
"payout": "2",
31
"status": "active",
32
"global_redirect_enabled": 0,
33
"currency": "USD",
34
"conversion_protocol": "2",
35
"is_ssl": "0",
36
"approve_conversions": "0"
37
},
38
"offer_platform": {
39
"target": [
40
{
41
"platform": "Mobile",
42
"system": "iOS",
43
"is_above":1,
44
"version": [
45
"5.1",
46
"6.0",
47
"6.1"
48
]
49
},
50
{
51
"platform": "Mobile",
52
"system": "Android",
53
"version": []
54
55
},
56
{
57
"platform": "PC",
58
"system": null,
59
"version": null
60
}
61
62
]
63
},
64
"offer_geo": {
65
"target": [
66
{
67
"type": 1,
68
"country": "Albania",
69
"city": []
70
},
71
{
72
"type": 1,
73
"country": "Armenia",
74
"city": [
75
"Kapan",
76
"Agarak",
77
"Azatamut"
78
]
79
},
80
{
81
"type":2,
82
"country": "China",
83
"city": [
84
"Guangzhou",
85
"shantou"
86
]
87
}
88
],
89
"type": 1
90
},
91
"offer_category": {
92
"name": "Music and Audio,test,Sunday"
93
},
94
"offer_cap": {
95
"cap_timezone": "Australia/Lord_Howe",
96
"adv_cap_type": 1,
97
"adv_cap_click": 10000,
98
"adv_cap_conversion": 100,
99
"adv_cap_revenue": "500",
100
"aff_cap_type": 3,
101
"aff_cap_click": 10000,
102
"aff_cap_conversion": 500,
103
"aff_cap_payout": "800.000"
104
}
105
}
106
');
107
108
try {
109
$response = $request->send();
110
111
echo $response->getBody();
112
} catch (HttpException $ex) {
113
echo $ex;
114
}
Copied!

Get

1
<?php
2
3
$request = new HttpRequest();
4
$request->setUrl('http://oltest1.api.offerslook.com/v1/offers');
5
$request->setMethod(HTTP_METH_GET);
6
7
$request->setHeaders(array(
8
'postman-token' => 'e129e164-8863-cab7-657e-92d61f1a0c58',
9
'cache-control' => 'no-cache',
10
'authorization' => 'Basic b2x0ZXN0MTo1YzVjZTZiMTZiMGE0NDNkOTg0ZDYyMjZlOTZkZGMzOQ==',
11
'content-type' => 'application/json'
12
));
13
14
try {
15
$response = $request->send();
16
17
echo $response->getBody();
18
} catch (HttpException $ex) {
19
echo $ex;
20
}
Copied!

Patch

1
<?php
2
3
HttpRequest::methodRegister('PATCH');
4
$request = new HttpRequest();
5
$request->setUrl('https://oltest.api.offerslook.com/v1/offers/19800,19801,19802,19803');
6
$request->setMethod(HttpRequest::HTTP_METH_PATCH);
7
8
$request->setQueryData(array(
9
'status' => 'paused'
10
));
11
12
$request->setHeaders(array(
13
'postman-token' => '479de210-0914-c3f8-0026-55d0ca1d32d3',
14
'cache-control' => 'no-cache',
15
'authorization' => 'Basic b2x0ZXN0MTo1YzVjZTZiMTZiMGE0NDNkOTg0ZDYyMjZlOTZkZGMzOQ=='
16
));
17
18
try {
19
$response = $request->send();
20
21
echo $response->getBody();
22
} catch (HttpException $ex) {
23
echo $ex;
24
}
Copied!

Delete

1
<?php
2
3
$request = new HttpRequest();
4
$request->setUrl('http://oltest1.api.offerslook.com/v1/offer_categories/464');
5
$request->setMethod(HTTP_METH_GET);
6
7
$request->setHeaders(array(
8
'postman-token' => 'ee764ea5-87b8-e44b-e8b0-a0d2f81880ae',
9
'cache-control' => 'no-cache',
10
'authorization' => 'Basic b2x0ZXN0MTo1YzVjZTZiMTZiMGE0NDNkOTg0ZDYyMjZlOTZkZGMzOQ=='
11
));
12
13
try {
14
$response = $request->send();
15
16
echo $response->getBody();
17
} catch (HttpException $ex) {
18
echo $ex;
19
}
Copied!
Last modified 9mo ago
Copy link