Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
20 changes: 20 additions & 0 deletions .fern/metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"cliVersion": "3.0.2",
"generatorName": "fernapi/fern-php-sdk",
"generatorVersion": "1.25.0",
"generatorConfig": {
"namespace": "Intercom",
"clientName": "IntercomClient",
"packageName": "intercom/intercom-php",
"propertyAccess": "private",
"inlinePathParameters": true,
"composerJson": {
"description": "Intercom API client.",
"author": {
"name": "Intercom Platform Team",
"url": "https://www.intercom.com"
},
"homepage": "https://developers.intercom.com/docs"
}
}
}
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
run: |
composer analyze

unit-tests:
test:
runs-on: ubuntu-latest

steps:
Expand All @@ -45,4 +45,4 @@ jobs:

- name: Run Tests
run: |
composer test
composer test
23 changes: 18 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,20 @@

The Intercom PHP library provides convenient access to the Intercom APIs from PHP.

## Table of Contents

- [Requirements](#requirements)
- [Installation](#installation)
- [Usage](#usage)
- [Exception Handling](#exception-handling)
- [Pagination](#pagination)
- [Legacy Sdk](#legacy-sdk)
- [Advanced](#advanced)
- [Custom Client](#custom-client)
- [Retries](#retries)
- [Timeouts](#timeouts)
- [Contributing](#contributing)

## Requirements

This SDK requires PHP ^8.1.
Expand All @@ -26,16 +40,14 @@ namespace Example;

use Intercom\IntercomClient;
use Intercom\AiContent\Requests\CreateContentImportSourceRequest;
use Intercom\AiContent\Types\CreateContentImportSourceRequestStatus;

$client = new IntercomClient(
token: '<token>',
);
$client->aiContent->createContentImportSource(
new CreateContentImportSourceRequest([
'syncBehavior' => 'api',
'status' => CreateContentImportSourceRequestStatus::Active->value,
'url' => 'url',
'url' => 'https://www.example.com',
]),
);

Expand Down Expand Up @@ -87,6 +99,7 @@ foreach ($items->getPages() as $page) {
}
```


## Legacy SDK

While the new SDK has a lot of improvements, we at Intercom understand that it takes time to upgrade when there are breaking changes.
Expand Down Expand Up @@ -156,7 +169,7 @@ A request is deemed retryable when any of the following HTTP status codes is ret
Use the `maxRetries` request option to configure this behavior.

```php
$response = $client->articles->create(
$response = $client->aiContent->createContentImportSource(
...,
options: [
'maxRetries' => 0 // Override maxRetries at the request level
Expand All @@ -169,7 +182,7 @@ $response = $client->articles->create(
The SDK defaults to a 30 second timeout. Use the `timeout` option to configure this behavior.

```php
$response = $client->articles->create(
$response = $client->aiContent->createContentImportSource(
...,
options: [
'timeout' => 3.0 // Override timeout to 3 seconds
Expand Down
Loading