MessageV2.ts•6.32 kB
/**
 * Generated by orval v7.9.0 🍺
 * Do not edit manually.
 * Carbon Voice Simplified API
 * # Introduction
The simplified version of the Carbon Voice API is designed to enhance usability for third-party clients looking to 
seamlessly integrate with our application. By streamlining authentication methods, providing clear error handling guidelines, 
and implementing straightforward rate limiting policies, we ensure that developers can quickly and efficiently connect to our services. 
This user-friendly approach minimizes complexity, making it easier for external applications to leverage the powerful communication 
features of Carbon Voice without extensive technical overhead.
This API is designed for people who feel comfortable integrating with RESTful APIs.
## Full API Version
We also have a full version of the API. You can find it [here](/docs).
## Terminology
 
* **Workspace**: An area that groups together people and Conversations.
* **Conversation**: A channel of communication. A grouping of people and messages related to a given topic.
* **Collaborators**: A group of people who are part of a Conversation.
* **Discussion**: Any post into a conversation
* **CarbonLink**: A link (on a website, QR code, or phone call) to start a conversation.
## BaseURL
This API is served over HTTPS.
All URLs referenced in the documentation have the following base: https://api.carbonvoice.app/api/simplified.
## Authentication
There are three ways to authenticate with this API:
* with an OAuth2 Access Token in the Authorization request header field 
(which uses the Bearer authentication scheme to transmit the Access Token)
* with your Client ID and Client Secret credentials
* with a PXToken
Each endpoint supports only one option.
<SecurityDefinitions />
## Errors
When an error occurs, you will receive an error object. Most of these error objects 
contain an error code and an error description so that your applications can more 
efficiently identify the problem.
If you get an 4xx HTTP response code, then you can assume that there is a bad request
from your end. In this case, check the [Error Responses section](#section/Introduction/Error-Responses) for more context.
5xx errors suggest a problem on our end, so in this case, check [Carbon Voice's Status](https://status.carbonvoice.app)
 to see how our systems are doing.
In any other case you can use our support options.
## Error Responses
`{ "success": false, requestId: "uuid", errmsg: "error message"`
## Rate-Limiting 
This API is subject to rate limiting. The limits differ per endpoint.
If you exceed the provided rate limit for a given endpoint, you will receive the 429
Too Many Requests response with the following message: Too many requests. Check the
X-RateLimit-Limit, X-RateLimit-Remaining and X-RateLimit-Reset headers.
For details on rate limiting, refer to Rate Limit Policy.
## Support
If you have problems or need help with your case, you can always reach out to our Support.
 * OpenAPI spec version: 1.0.0
 */
import type { MessageV2UtmData } from './MessageV2UtmData';
import type { Attachment } from './Attachment';
import type { ReactionSummary } from './ReactionSummary';
import type { MessageV2Status } from './MessageV2Status';
import type { AudioModelV2 } from './AudioModelV2';
import type { TextModel } from './TextModel';
import type { MessageV2AudioDelivery } from './MessageV2AudioDelivery';
import type { UsersNotAllowedReceiveNotifications } from './UsersNotAllowedReceiveNotifications';
import type { UsersNotAllowedReceiveNotificationsV2 } from './UsersNotAllowedReceiveNotificationsV2';
import type { MessageV2UsersCaughtUp } from './MessageV2UsersCaughtUp';
import type { MessageV2Type } from './MessageV2Type';
export interface MessageV2 {
  message_id: string;
  creator_id: string;
  created_at: string;
  /** @nullable */
  deleted_at?: string | null;
  last_updated_at: string;
  workspace_ids: string[];
  channel_ids: string[];
  /** @nullable */
  parent_message_id?: string | null;
  /**
   * The number of ms of audio listened to by the user requesting the message
   * @nullable
   */
  heard_ms?: number | null;
  /** @nullable */
  utm_data?: MessageV2UtmData;
  attachments: Attachment[];
  notes: string;
  /** Has the logged in user cleared the notification for this message */
  notify: boolean;
  /**
   * Last time we listened/updated notify bit
   */
  last_heard_update: string;
  reaction_summary: ReactionSummary;
  /** @nullable */
  name?: string | null;
  is_text_message: boolean;
  status: MessageV2Status;
  label_ids: string[];
  audio_models: AudioModelV2[];
  text_models: TextModel[];
  /** @nullable */
  source_message_id: string | null;
  cache_key: string;
  audio_delivery: MessageV2AudioDelivery;
  users_not_allowed_to_receive_notifications?: UsersNotAllowedReceiveNotifications[];
  users_not_allowed_to_receive_notifications_v2?: UsersNotAllowedReceiveNotificationsV2[];
  /** The length of the message in milliseconds */
  duration_ms: number;
  /** The number of ms of audio listened to by all users */
  total_heard_ms: number;
  /** Then number of users who have a notification for this message and have not listened to the audio. */
  notified_users: number;
  /** The number of users that listened to the audio or removed the notification */
  users_caught_up: MessageV2UsersCaughtUp;
  /**
   * The ID of a forwarded message (Deprecated, for new implementations we should start using share_link_id
   * @deprecated
   * @nullable
   */
  forward_id?: string | null;
  /**
   * The ID of a Share Link to a message
   * @nullable
   */
  share_link_id?: string | null;
  /**
   * The stream key used to add audio to the message
   * @nullable
   */
  stream_key?: string | null;
  /**
   * The number of times the socket disconnected while the creator was sending audio
   */
  socket_disconnects_while_streaming: number;
  /**
   * Message type
   * @nullable
   */
  type: MessageV2Type;
  /**
   * The sequencial id of the message within the channel
   */
  channel_sequence: number;
  /**
   * The last time anyone listened or cleared notified on this message
   */
  last_heard_at: string;
  /**
   * Folder ID, only present when the message type is one of: voicememo,prerecorded
   * @nullable
   */
  folder_id?: string | null;
}