createPosts2 method
Future<CreatePosts200Response?>
createPosts2(
- String companyId,
- String postId,
- String integrationId,
- PostsInput postsInput,
Publish a post to an external platform via an integration. Args: post_id: ID of the post to publish integration_id: ID of the integration to use (from postgen_integrations) Returns: Publication record with external_url and external_post_id
Parameters:
-
String companyId (required): Unique identifier for the Company
-
String postId (required): Unique identifier for the Post
-
String integrationId (required): Unique identifier for the Integration
-
PostsInput postsInput (required):
Implementation
Future<CreatePosts200Response?> createPosts2(String companyId, String postId, String integrationId, PostsInput postsInput,) async {
final response = await createPosts2WithHttpInfo(companyId, postId, integrationId, postsInput,);
if (response.statusCode >= HttpStatus.badRequest) {
throw ApiException(response.statusCode, await _decodeBodyBytes(response));
}
// When a remote server returns no body with a status of 204, we shall not decode it.
// At the time of writing this, `dart:convert` will throw an "Unexpected end of input"
// FormatException when trying to decode an empty string.
if (response.body.isNotEmpty && response.statusCode != HttpStatus.noContent) {
return await apiClient.deserializeAsync(await _decodeBodyBytes(response), 'CreatePosts200Response',) as CreatePosts200Response;
}
return null;
}