> ## Documentation Index
> Fetch the complete documentation index at: https://docs.thenewscc.com.br/llms.txt
> Use this file to discover all available pages before exploring further.

# Registrar Compartilhamento

> Registra quando um usuário compartilha seu streak

## Descrição

Registra quando um usuário compartilha seu streak em redes sociais.

## Request Body

<ParamField body="email" type="string" required>
  Email do usuário
</ParamField>

<ParamField body="platform" type="string" required>
  Plataforma onde foi compartilhado (twitter, facebook, instagram, whatsapp, etc)
</ParamField>

## Response

<ResponseField name="success" type="boolean">
  Indica se a operação foi bem-sucedida
</ResponseField>

<ResponseField name="message" type="string">
  Mensagem informativa sobre o resultado
</ResponseField>

<ResponseField name="data" type="object">
  <Expandable title="properties">
    <ResponseField name="shareId" type="string">
      ID único do compartilhamento
    </ResponseField>

    <ResponseField name="email" type="string">
      Email do usuário
    </ResponseField>

    <ResponseField name="platform" type="string">
      Plataforma do compartilhamento
    </ResponseField>

    <ResponseField name="sharedAt" type="string">
      Data e hora do compartilhamento
    </ResponseField>

    <ResponseField name="currentStreak" type="number">
      Streak no momento do compartilhamento
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash theme={null}
  curl --request POST \
    --url https://backend.testeswaffle.org/streaks/share \
    --header 'Content-Type: application/json' \
    --data '{
      "email": "leitor@exemplo.com",
      "platform": "twitter"
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
    "success": true,
    "message": "Compartilhamento registrado com sucesso",
    "data": {
      "shareId": "share_123456",
      "email": "leitor@exemplo.com",
      "platform": "twitter",
      "sharedAt": "2024-01-20T15:30:00Z",
      "currentStreak": 30
    }
  }
  ```
</ResponseExample>


## OpenAPI

````yaml POST /streaks/share
openapi: 3.1.0
info:
  title: Streaks API
  description: API para gerenciamento de streaks e gamificação de leitura do the news
  version: 1.0.0
servers:
  - url: https://backend.testeswaffle.org
security:
  - bearerAuth: []
paths:
  /streaks/share:
    post:
      tags:
        - Streaks
      summary: Registrar Compartilhamento
      description: Registra quando um usuário compartilha seu streak
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - email
                - platform
              properties:
                email:
                  type: string
                  format: email
                  description: Email do usuário
                platform:
                  type: string
                  description: Plataforma de compartilhamento
                  enum:
                    - twitter
                    - facebook
                    - instagram
                    - whatsapp
                    - linkedin
      responses:
        '200':
          description: Compartilhamento registrado com sucesso
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  message:
                    type: string
                  data:
                    type: object
                    properties:
                      shareId:
                        type: string
                      email:
                        type: string
                      platform:
                        type: string
                      sharedAt:
                        type: string
                        format: date-time
                      currentStreak:
                        type: number
      security: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT

````