Skip to content

Commit 26a5402

Browse files
author
Abedalaziz Jamous
committed
add fetchArticleManpower
1 parent 0c17e4e commit 26a5402

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

src/Articles/Article.php

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,9 @@ class Article
1111
const PUBLISH_ARTICLE_URI = 'client-api/articles/publish';
1212

1313
const GET_WRITER_INFO_URI = 'client-api/manpower/';
14-
14+
15+
const GET_ARTICLE_MANPOWER = 'client-api/articles/manpower';
16+
1517
/**
1618
* base_uri
1719
*
@@ -192,5 +194,22 @@ public function fetchWriter(Int $writer_id)
192194
$responseContent = json_decode($response->getBody()->getContents());
193195
return $responseContent->data;
194196
}
197+
198+
public function fetchArticleManpower(Int $article_id)
199+
{
200+
$request_uri = self::GET_ARTICLE_MANPOWER;
201+
// Send a request to $request_uri
202+
$response = $this->client->request('GET', $request_uri, [
203+
'headers' => [
204+
'Authorization' => 'Bearer ' . $this->token,
205+
'Content-Type' => 'application/json',
206+
'Accesp' => 'application/json'
207+
],
208+
'body' => json_encode(["articles" => [$article_id]]),
209+
]);
210+
211+
$responseContent = json_decode($response->getBody()->getContents());
212+
return $responseContent->data;
213+
}
195214
}
196215

0 commit comments

Comments
 (0)