Self Service Endpoints - supportpal/api-client-php GitHub Wiki
Below are the currently supported self-service endpoints.
Articles
GET /selfservice/article
$articles = $api->getSelfServiceApi()->getArticles();
You can filter the results as shown below. For a full list of supported filtering options, see https://api.supportpal.com/api.html#self-service-article-get
$articles = $api->getSelfServiceApi()->getArticles(['type_id' => 1]);
GET /selfservice/article/{id}
$article = $api->getSelfServiceApi()->getArticle($id);
Additional query parameters are available. For a full list of supported filtering options, see https://api.supportpal.com/api.html#self-service-article-get-1
$article = $api->getSelfServiceApi()->getArticle($id, ['type_id' => 1, 'increment_views' => 1]);
GET /selfservice/article/search
$articles = $api->getSelfServiceApi()->getArticlesByTerm($term = 'foo');
Additional filtering options are available. For a full list of supported filtering options, see https://api.supportpal.com/api.html#self-service-article-get-2
$articles = $api->getSelfServiceApi()->getArticlesByTerm($term = 'foo', ['type_id' => 1]);
GET /selfservice/article/related
$articles = $api->getSelfServiceApi()->getRelatedArticles($typeId = 1, $term = 'foo');
Additional filtering options are available. For a full list of supported filtering options, see https://api.supportpal.com/api.html#self-service-article-get-3
$articles = $api->getSelfServiceApi()->getRelatedArticles($typeId = 1, $term = 'foo', ['protected' => 1]);
POST /selfservice/article
$createArticle = new \SupportPal\ApiClient\Model\SelfService\Request\CreateArticle([
'author_id' => 1,
'title' => 'Article title',
'text' => 'Article text',
'category' => [1],
]);
$article = $api->getSelfServiceApi()->createArticle($createArticle);
For a full list of parameters, see https://api.supportpal.com/api.html#self-service-article-post
PUT /selfservice/article/{id}
$updateArticle = new \SupportPal\ApiClient\Model\SelfService\Request\UpdateArticle(['published' => 1]);
$article = $api->getSelfServiceApi()->updateArticle($id, $updateOperator);
For a full list of parameters, see https://api.supportpal.com/api.html#self-service-article-put
DELETE /selfservice/article/{id}
$api->getSelfServiceApi()->deleteArticle($id);
Article Attachments
GET /selfservice/attachment
$attachments = $api->getSelfServiceApi()->getAttachments();
You can filter the results as shown below. For a full list of supported filtering options, see https://api.supportpal.com/api.html#self-service-article-attachment-get
$attachments = $api->getSelfServiceApi()->getAttachments(['article_id' => 1]);
GET /selfservice/attachment/{id}
$attachment = $api->getSelfServiceApi()->getAttachment(1);
GET /selfservice/attachment/{id}/download
$stream = $api->getSelfServiceApi()->downloadAttachment(1);
A StreamInterface is returned.
POST /selfservice/attachment
$createAttachment = new \SupportPal\ApiClient\Model\SelfService\Request\CreateAttachment([
'article_id' => 1,
'filename' => 'filename.txt',
'contents' => base64_encode(file_get_contents($path)),
]);
$article = $api->getSelfServiceApi()->createAttachment($createAttachment);
For a full list of parameters, see https://api.supportpal.com/api.html#self-service-article-attachment-post
DELETE /selfservice/attachment/{id}
$api->getSelfServiceApi()->deleteAttachment($id);
Categories
GET /selfservice/category
$categories = $api->getSelfServiceApi()->getCategories();
Additional filtering options are available. For a full list of available filtering options, see https://api.supportpal.com/api.html#self-service-category-get
$categories = $api->getSelfServiceApi()->getCategories(['type_id' => 1]);
GET /selfservice/category/{id}
$category = $api->getSelfServiceApi()->getCategory($id);
Comments
GET /selfservice/comment
$comments = $api->getSelfServiceApi()->getComments();
Additional filtering options are available. For a full list of available filtering options, see https://api.supportpal.com/api.html#self-service-comment-get
$comments = $api->getSelfServiceApi()->getComments(['type_id' => 1]);
POST /selfservice/comment
$createComment = new \SupportPal\ApiClient\Model\SelfService\Request\CreateComment([
'text' => 'foo',
'article_id' => 3,
'type_id' => 1,
'parent_id' => 1,
'status' => 3,
'notify_reply' => 0
]);
$api->getSelfServiceApi()->createComment($createComment);
For a full list of parameters, see https://api.supportpal.com/api.html#self-service-comment-post
Settings
GET /selfservice/settings
$settings = $api->getSelfServiceApi()->getSettings();
Tags
GET /selfservice/tag
$tags = $api->getSelfServiceApi()->getTags();
Additional filtering options are available. For a full list of filtering options, see https://api.supportpal.com/api.html#self-service-tag-get
$tags = $api->getSelfServiceApi()->getTags(['order_column' => 'name]);
GET /selfservice/tag/{id}
$tag = $api->getSelfServiceApi()->getTag($id);
Types
GET /selfservice/type
$types = $api->getSelfServiceApi()->getTypes();
Additional filtering options are available. For a full list of filtering options, see https://api.supportpal.com/api.html#self-service-type-get
$types = $api->getSelfServiceApi()->getTypes(['brand_id' => 1]);
GET /selfservice/type/{id}
$type = $api->getSelfServiceApi()->getType($id);