Skip to content

Commit 5a97915

Browse files
authored
Merge pull request #32 from jcsnider/patch-1
Make API Compatible with Intersect Beta 8
2 parents 44db864 + 76e1bfb commit 5a97915

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

src/Settings/Api.php

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,12 @@ public function APIcall_POST(string $server, array $postData, string $access_tok
8484
return (curl_error($ch));
8585
}
8686

87+
$httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
88+
89+
if ($httpcode == 401 || $httpcode == 403) {
90+
$response = '{"Message": "Authorization has been denied for this request."}';
91+
}
92+
8793
$responseData = json_decode($response, true);
8894
curl_close($ch);
8995

@@ -126,6 +132,12 @@ public function APIcall_GET(string $server, string $access_token, string $callty
126132
return (curl_error($ch));
127133
}
128134

135+
$httpcode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
136+
137+
if ($httpcode == 401 || $httpcode == 403) {
138+
$response = '{"Message": "Authorization has been denied for this request."}';
139+
}
140+
129141
$responseData = json_decode($response, true);
130142
curl_close($ch);
131143
return $responseData;

0 commit comments

Comments
 (0)