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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/release-notes/v1.0.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ composer require moderation-api/sdk-php:^1.0

- Requires PHP 8.2 or later (was 8.1).
- The namespace is `ModerationApi` (was `ModerationAPI`). Create the client with `ModerationApi\ModerationApi::builder()->setSecurity($key)->build()`.
- Requests are typed objects, for example `new Operations\SubmitContentRequest(content: new Operations\TextRequest(text: '...'))`, and responses carry the result in `->object`.
- Requests are typed objects, for example `new Operations\SubmitContentRequestBody(content: new Operations\TextRequest(text: '...'))`, and responses carry the result in `->object`.
- Verify webhooks with `ModerationApi\WebhookSignature::constructEvent($payload, $signature)`.
### What's new

Expand Down
10 changes: 5 additions & 5 deletions .speakeasy/gen.lock
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
lockVersion: 2.0.0
id: 0199302d-9d48-4081-a021-a66e7a11ce41
management:
docChecksum: c27787b45fc5b72aafff31ba945a9e61
docChecksum: 38730339aa1da77855e86c169896f12f
docVersion: 1.1.0
speakeasyVersion: internal
generationVersion: internal
releaseVersion: 1.1.0
configChecksum: 02c26a6ca40c5c5326664594c00efaf8
releaseVersion: 1.1.1
configChecksum: fc3cb529f9d6cc0b51976839fc7521ff
repoURL: https://github.com/moderation-api/sdk-php
installationURL: https://github.com/moderation-api/sdk-php.git
published: true
Expand Down Expand Up @@ -1460,15 +1460,15 @@ trackedFiles:
src/Models/Operations/WithinUnit.php:
last_write_checksum: sha1:2bcee79806e20da2d6ea91de1185cbef7b687a2c
src/ModerationApi.php:
last_write_checksum: sha1:51aa6c5b26801f0dedc546eff7fa3e210972787f
last_write_checksum: sha1:125a0b3d40a2adc7cb0392536b632611a2842a16
src/ModerationApiBuilder.php:
last_write_checksum: sha1:16809f5bed82b4ad4c18f3322de18d04e32a372d
src/Projects.php:
last_write_checksum: sha1:50ff2ba13fe33e6d62384ff9825977e6efd40a34
src/Queue.php:
last_write_checksum: sha1:6e827e98b2489b7f06b1d5869e54f47e6ae2816c
src/SDKConfiguration.php:
last_write_checksum: sha1:83f89b5b0365374df283316c53a96f9cfc99f1d5
last_write_checksum: sha1:63ff169e43e51e25c2eaa43940df61e4c0fdcd25
src/Utils/BigDecimalHandler.php:
last_write_checksum: sha1:2d36b5ae690b042acfcdfe7e7277d44c5055416f
src/Utils/BigIntHandler.php:
Expand Down
2 changes: 1 addition & 1 deletion .speakeasy/gen.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ generation:
generateNewTests: true
skipResponseBodyAssertions: false
php:
version: 1.1.0
version: 1.1.1
additionalDependencies:
autoload: {}
autoload-dev: {}
Expand Down
2 changes: 1 addition & 1 deletion .speakeasy/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
},
"servers": [
{
"url": "https://moderationapi.com/api/v1"
"url": "https://api.moderationapi.com/v1"
}
],
"tags": [
Expand Down
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 1.1.1 (2026-10-22)

Full Changelog: [v1.1.0...v1.1.1](https://github.com/moderation-api/sdk-php/compare/v1.1.0...v1.1.1)

### Chores

- Update the generated code.

## 1.1.0 (2026-10-22)

Full Changelog: [v1.0.0...v1.1.0](https://github.com/moderation-api/sdk-php/compare/v1.0.0...v1.1.0)
Expand Down
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ $sdk = ModerationApi::builder()
->build();

// Text
$sdk->content->submit(new Operations\SubmitContentRequest(
$sdk->content->submit(new Operations\SubmitContentRequestBody(
content: new Operations\TextRequest(text: 'Your text here'),
contentId: 'message-123', // your ID for the content
authorId: 'user-123', // your ID for the user who wrote it
Expand All @@ -119,18 +119,18 @@ $sdk->content->submit(new Operations\SubmitContentRequest(
));

// Image, video and audio: send a URL
$sdk->content->submit(new Operations\SubmitContentRequest(
$sdk->content->submit(new Operations\SubmitContentRequestBody(
content: new Operations\ImageRequest(url: 'https://example.com/image.jpg'),
));
$sdk->content->submit(new Operations\SubmitContentRequest(
$sdk->content->submit(new Operations\SubmitContentRequestBody(
content: new Operations\VideoRequest(url: 'https://example.com/video.mp4'),
));
$sdk->content->submit(new Operations\SubmitContentRequest(
$sdk->content->submit(new Operations\SubmitContentRequestBody(
content: new Operations\AudioRequest(url: 'https://example.com/audio.mp3'),
));

// An object with several fields, moderated together
$sdk->content->submit(new Operations\SubmitContentRequest(
$sdk->content->submit(new Operations\SubmitContentRequestBody(
content: new Operations\ObjectT(data: [
'title' => new Operations\DataText(text: 'Post title'),
'body' => new Operations\DataText(text: 'Post content'),
Expand All @@ -144,7 +144,7 @@ $sdk->content->submit(new Operations\SubmitContentRequest(
`evaluation->flagged` tells you if any policy flagged the content. `recommendation->action` is the action the API recommends after it applies your thresholds and rules: `allow`, `review` or `reject`.

```php
$response = $sdk->content->submit(new Operations\SubmitContentRequest(
$response = $sdk->content->submit(new Operations\SubmitContentRequestBody(
content: new Operations\TextRequest(text: 'Some content'),
));
$result = $response->object;
Expand Down Expand Up @@ -494,7 +494,7 @@ use ModerationApi;
use ModerationApi\Models\Operations;

$sdk = ModerationApi\ModerationApi::builder()
->setServerURL('https://moderationapi.com/api/v1')
->setServerURL('https://api.moderationapi.com/v1')
->setSecurity(
'<YOUR_BEARER_TOKEN_HERE>'
)
Expand Down
2 changes: 1 addition & 1 deletion src/ModerationApi.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
class ModerationApi
{
public const SERVERS = [
'https://moderationapi.com/api/v1',
'https://api.moderationapi.com/v1',
];

public Authors $authors;
Expand Down
4 changes: 2 additions & 2 deletions src/SDKConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ class SDKConfiguration

public string $openapiDocVersion = '1.1.0';

public string $sdkVersion = '1.1.0';
public string $sdkVersion = '1.1.1';

public string $genVersion = 'internal';

public string $userAgent = 'speakeasy-sdk/php 1.1.0 internal 1.1.0 moderation-api/sdk-php';
public string $userAgent = 'speakeasy-sdk/php 1.1.1 internal 1.1.0 moderation-api/sdk-php';

public ?RetryConfig $retryConfig = null;

Expand Down
Loading