openapi: 3.0.0
info:
  title: Email
  description: Everything about sending Emails
servers:
  - url: https://rest.clicksend.com
components:
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
  schemas:
    attachment:
      type: object
      properties:
        file_name:
          type: string
          description: The name of the attached file.
        content_type:
          type: string
          description: The MIME type of the attached file.
        content_disposition:
          type: string
          description: The content disposition of the attached file.
        content_id:
          type: string
          description: The content ID of the attached file.
        _attachment_file_url:
          type: string
          format: uri
          description: The URL to download the attached file.
    currency:
      type: object
      description: The parameters related to currency.
      properties:
        currency_name_short:
          type: string
          description: >-
            The currency used for the sender in three-letter format (e.g. USD,
            EUR, AUD, NZD, etc).
          example: AUD
        currency_prefix_d:
          type: string
          description: >-
            The symbol used to indicate the currency of the sender (e.g. $ , €,
            etc).
          example: $
        currency_prefix_c:
          type: string
          description: The currency basic unit (e.g. cents).
          example: c
        currency_name_long:
          type: string
          description: The full name of the currency.
          example: Australian Dollars
    transactional_email:
      type: object
      properties:
        user_id:
          type: integer
          description: The ID of the user.
          example: 1
        subaccount_id:
          type: integer
          description: The ID of the subaccount.
          example: 1
        from_email_address_id:
          type: integer
          description: The ID of the from email address.
          example: 1
        from_name:
          type: string
          description: The name of the sender.
          example: Joanne Doe
        to:
          type: array
          items:
            type: object
            properties:
              email:
                type: string
                description: The email address of the recipient.
              name:
                type: string
                description: The name of the recipient.
          example:
            - email: test@clicksend.com
              name: John Doe
        cc:
          type: array
          items:
            type: object
            properties:
              email:
                type: string
                description: The email address of the CC recipient.
              name:
                type: string
                description: The name of the CC recipient.
          example:
            - email: test2@clicksend.com
              name: Jane Doe
        bcc:
          type: array
          items:
            type: object
            properties:
              email:
                type: string
                description: The email address of the BCC recipient.
              name:
                type: string
                description: The name of the BCC recipient.
          example:
            - email: test3@clicksend.com
              name: Joseph Doe
        subject:
          type: string
          description: The subject of the email.
          example: Test subject
        body:
          type: string
          description: The HTML body of the email.
          example: Lorem ipsum
        body_plain_text:
          type: string
          description: The plain text body of the email.
          example: Lorem ipsum
        schedule:
          type: integer
          description: The timestamp indicating the scheduled time of the email.
          example: 1507018182
        message_id:
          type: string
          description: The ID of the email message.
          example: 21C632C1-3FCC-4EFF-8191-6079244F0142
        status:
          type: string
          description: The status of the email.
          example: WaitApproval
        status_text:
          type: string
          description: The text description of the email status.
          example: Accepted for delivery
        soft_bounce_count:
          type: integer
          description: The count of soft bounces.
          example: 0
        hard_bounce_count:
          type: integer
          description: The count of hard bounces.
          example: 0
        price:
          type: string
          description: The price of the email.
          example: '0.0050'
        date_added:
          type: integer
          description: The timestamp indicating when the email was added.
          example: 1507018182
        custom_string:
          type: string
          nullable: true
          description: A custom string.
          example: null
        _attachments:
          type: array
          items:
            $ref: '#/components/schemas/attachment'
          example:
            - file_name: text.txt
              content_type: text/plain
              content_disposition: attachment
              content_id: text
              _attachment_file_url: >-
                https://rest.clicksend.com/files/3C2284DC-7C37-47BA-8C95-3F12A4B987B7.txt
        _currency:
          $ref: '#/components/schemas/currency'
          example:
            currency_name_short: GBP
            currency_prefix_d: £
            currency_prefix_c: p
            currency_name_long: British Pounds
    send-email:
      type: object
      properties:
        http_code:
          type: integer
          description: The HTTP status code of the response.
          example: 200
        response_code:
          type: string
          description: The response code indicating the status of the operation.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: Transactional email queued for delivery.
        data:
          $ref: '#/components/schemas/transactional_email'
    pagination:
      type: object
      properties:
        total:
          type: integer
          description: The total number of items available for viewing.
          example: 2
        per_page:
          type: integer
          description: >-
            The number of items returned per page. This is specified in the
            limit parameter. You can have 100 items at maximum, and 15 at
            minimum.
          example: 15
        current_page:
          type: integer
          description: The current page number.
          example: 1
        last_page:
          type: integer
          description: The last page number.
          example: 1
        next_page_url:
          type: string
          nullable: true
          description: >-
            A URL of the next page. It will return **null** if there’s no next
            page.
          example: null
        prev_page_url:
          type: string
          nullable: true
          description: >-
            A URL of the previous page. It will return **null** if there’s no
            previous page.
          example: null
        from:
          type: integer
          description: The number of the first result in the current page.
          example: 1
        to:
          type: integer
          description: The number of the last result in the current page.
          example: 2
    calculate-email-price:
      type: object
      properties:
        http_code:
          type: integer
          description: The HTTP status code of the response.
          example: 200
        response_code:
          type: string
          description: The response code indicating the status of the operation.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: Here's your price.
        data:
          allOf:
            - $ref: '#/components/schemas/pagination'
            - type: array
              items:
                $ref: '#/components/schemas/transactional_email'
    view-email-history:
      type: object
      properties:
        http_code:
          type: integer
          description: The HTTP status code of the response.
          example: 200
        response_code:
          type: string
          description: The response code indicating the status of the operation.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: Here is your result.
        data:
          allOf:
            - $ref: '#/components/schemas/pagination'
            - type: array
              items:
                $ref: '#/components/schemas/transactional_email'
    export-email-history:
      type: object
      properties:
        http_code:
          type: integer
          description: The HTTP status code of the response.
          example: 200
        response_code:
          type: string
          description: The response code indicating the status of the operation.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: Download your file here.
        data:
          type: object
          properties:
            url:
              type: string
              description: The URL of the exported file.
              example: >-
                https://rest.clicksend.com/files/22D55AF9-6CF0-476D-A8B3-82A998FD2738?filename=export.csv
    email_address:
      type: object
      properties:
        email_address_id:
          type: integer
          description: The unique identifier for the email address.
          example: 2
        email_address:
          type: string
          format: email
          description: The email address.
          example: test2@user.com
        verified:
          type: integer
          description: Flag indicating if the email address is verified.
          example: 0
        date_added:
          type: string
          description: The date the email address was added.
          example: '1436157486'
    view-allowed-email-addresses:
      type: object
      properties:
        http_code:
          type: integer
          description: The HTTP status code of the response.
          example: 200
        response_code:
          type: string
          description: The response code indicating the status of the operation.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: Here are your email addresses
        data:
          allOf:
            - $ref: '#/components/schemas/pagination'
            - type: object
              properties:
                data:
                  type: array
                  items:
                    $ref: '#/components/schemas/email_address'
                  example:
                    - email_address_id: 2
                      email_address: test@user.com
                      verified: 1
                      date_added: '1447736880'
                    - email_address_id: 3
                      email_address: test2@user.com
                      verified: 0
                      date_added: '1449042967'
    create-allowed-email-address:
      type: object
      properties:
        http_code:
          type: integer
          description: The HTTP status code of the response.
          example: 200
        response_code:
          type: string
          description: The response code indicating the status of the operation.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: Email address has been created.
        data:
          $ref: '#/components/schemas/email_address'
    send-email-verification-token:
      type: object
      properties:
        http_code:
          type: integer
          description: The HTTP status code of the response.
          example: 200
        response_code:
          type: string
          description: The response code indicating the status of the operation.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: Verification email has been sent.
        data:
          type: object
          nullable: true
          example: null
    verify-allowed-email-address:
      type: object
      properties:
        http_code:
          type: integer
          description: The HTTP status code of the response.
          example: 200
        response_code:
          type: string
          description: The response code indicating the status of the operation.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: Email address verified.
        data:
          $ref: '#/components/schemas/email_address'
    view-allowed-email-address:
      type: object
      properties:
        http_code:
          type: integer
          description: The HTTP status code of the response.
          example: 200
        response_code:
          type: string
          description: The response code indicating the status of the operation.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: Here is your email address.
        data:
          $ref: '#/components/schemas/email_address'
    delete-allowed-email-address:
      type: object
      properties:
        http_code:
          type: integer
          description: The HTTP status code of the response.
          example: 200
        response_code:
          type: string
          description: The response code indicating the status of the operation.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: Email address deleted.
        data:
          type: object
          nullable: true
          example: null
    email_campaign:
      type: object
      properties:
        email_campaign_id:
          type: integer
          description: The ID of the email campaign.
          example: 64
        name:
          type: string
          description: The name of the email campaign.
          example: test email
        user_id:
          type: integer
          description: The ID of the user who created the email campaign.
          example: 1201
        subaccount_id:
          type: integer
          description: The ID of the subaccount associated with the email campaign.
          example: 1038
        subject:
          type: string
          description: The subject of the email campaign.
          example: My test subject
        list_id:
          type: integer
          description: The ID of the email list associated with the campaign.
          example: 443
        from_email_address_id:
          type: integer
          description: The ID of the sender's email address.
          example: 2
        from_name:
          type: string
          description: The name of the sender.
          example: Test name
        template_id:
          type: integer
          description: The ID of the email template used in the campaign.
          example: 24
        schedule:
          type: string
          description: The schedule for sending the email campaign.
          example: ''
        status:
          type: string
          description: The status of the email campaign (e.g., Sent, Scheduled, Draft).
          example: Sent
        date_added:
          type: string
          description: The date when the email campaign was added.
          example: '1455586793'
        custom_string:
          type: string
          description: A custom string associated with the email campaign.
          example: ''
        send_count:
          type: integer
          description: The count of emails sent in the campaign.
          example: 0
        open_count:
          type: integer
          description: The count of emails opened in the campaign.
          example: 5
        click_count:
          type: integer
          description: The count of links clicked in the campaign.
          example: 0
        hard_bounce_count:
          type: integer
          description: The count of hard bounces in the campaign.
          example: 0
        soft_bounce_count:
          type: integer
          description: The count of soft bounces in the campaign.
          example: 0
        abuse_count:
          type: integer
          description: The count of abuse complaints in the campaign.
          example: 0
        unsubscribe_count:
          type: integer
          description: The count of unsubscribes in the campaign.
          example: 0
        body:
          type: string
          description: The body of the email campaign.
          example: test body
        body_plain_text:
          type: string
          description: The plain text body of the email campaign.
          example: test body
    send-email-campaign:
      type: object
      properties:
        http_code:
          type: integer
          description: The HTTP status code of the response.
          example: 200
        response_code:
          type: string
          description: The response code indicating the status of the operation.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: Email campaign has been created.
        data:
          type: object
          properties:
            totlal_count:
              type: number
              example: 1
              description: The total count of the email campaigns.
            total_price:
              type: string
              example: '0.0066'
              description: The total price of the email campaigns.
            queued_count:
              type: number
              example: 1
              description: The count of the queued email campaigns.
            data:
              $ref: '#/components/schemas/email_campaign'
            _currency:
              $ref: '#/components/schemas/currency'
    calculate-email-campaign-price:
      type: object
      properties:
        http_code:
          type: integer
          description: The HTTP status code of the response.
          example: 200
        response_code:
          type: string
          description: The response code indicating the status of the operation.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: Total price for email campaign.
        data:
          type: object
          properties:
            total_count:
              type: number
              example: 1
              description: The total count of the email campaigns.
            total_price:
              type: string
              example: '0.0066'
              description: The total price of the email campaigns.
            queued_count:
              type: number
              example: 2
              description: The count of the queued email campaigns.
            data:
              type: object
              properties:
                name:
                  type: string
                  example: John Doe
                  description: Name.
                subject:
                  type: string
                  example: Lorem Ipsum
                  description: Your template subject.
                from_email_address_id:
                  type: number
                  example: 2
                  description: The allowed email address id.
                from_name:
                  type: string
                  example: From name
                  description: Your sender name.
                body:
                  type: string
                  example: <p>This is a test</p>
                  description: Your message.
                list_id:
                  type: number
                  example: 456
                  description: Your list id.
            _currency:
              $ref: '#/components/schemas/currency'
    view-all-email-campaigns:
      type: object
      properties:
        http_code:
          type: integer
          description: The HTTP status code of the response.
          example: 200
        response_code:
          type: string
          description: The response code indicating the status of the operation.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: Here are your email campaigns
        data:
          allOf:
            - $ref: '#/components/schemas/pagination'
            - type: object
              properties:
                data:
                  type: array
                  items:
                    $ref: '#/components/schemas/email_campaign'
                  example:
                    - email_campaign_id: 64
                      name: test email
                      user_id: 1201
                      subaccount_id: 1038
                      subject: My test subject
                      list_id: 443
                      from_email_address_id: 2
                      from_name: Test name
                      template_id: 24
                      schedule: ''
                      status: Sent
                      date_added: '1455586793'
                      custom_string: ''
                      send_count: 0
                      open_count: 5
                      click_count: 0
                      hard_bounce_count: 0
                      soft_bounce_count: 0
                      abuse_count: 0
                      unsubscribe_count: 0
                    - email_campaign_id: 65
                      name: test email
                      user_id: 1201
                      subaccount_id: 1038
                      subject: My test subject
                      list_id: 443
                      from_email_address_id: 2
                      from_name: Test name
                      template_id: 24
                      schedule: ''
                      status: Queued
                      date_added: '1455586848'
                      custom_string: ''
                      send_count: 0
                      open_count: 5
                      click_count: 0
                      hard_bounce_count: 0
                      soft_bounce_count: 0
                      abuse_count: 0
                      unsubscribe_count: 0
    view-email-campaign:
      type: object
      properties:
        http_code:
          type: integer
          description: The HTTP status code of the response.
          example: 200
        response_code:
          type: string
          description: The response code indicating the status of the operation.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: Here is your email campaign.
        data:
          $ref: '#/components/schemas/email_campaign'
    update-email-campaign:
      type: object
      properties:
        http_code:
          type: integer
          description: The HTTP status code of the response.
          example: 200
        response_code:
          type: string
          description: The response code indicating the status of the operation.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: Email campaign has been updated.
        data:
          $ref: '#/components/schemas/email_campaign'
    cancel-email-campaign:
      type: object
      properties:
        http_code:
          type: integer
          description: The HTTP status code of the response.
          example: 200
        response_code:
          type: string
          description: The response code indicating the status of the operation.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: Email campaign has been cancelled.
        data:
          $ref: '#/components/schemas/email_campaign'
    email_campaign_history:
      type: object
      properties:
        email_campaign_id:
          type: integer
          description: The ID of the email campaign.
          example: 77
        from_name:
          type: string
          description: The name of the sender.
          example: test name
        from_address:
          type: string
          description: The email address of the sender.
          example: '4'
        to_name:
          type: string
          description: The name of the recipient.
          example: test2@test.com
        to_address:
          type: string
          description: The email address of the recipient.
          example: test2@test.com
        contact_id:
          type: integer
          description: The ID of the contact associated with the email.
          example: 669105
        subject:
          type: string
          description: The subject of the email.
          example: test subject
        message_id:
          type: string
          description: The unique ID of the email message.
          example: 7CB3227C-7F8C-4A72-A0CB-36283236D99F
        processed_at:
          type: string
          nullable: true
          description: The date and time when the email was processed.
          example: null
        status:
          type: string
          description: The status of the email (e.g., SpamReport, Sent).
          example: SpamReport
        open_count:
          type: integer
          description: The count of times the email was opened.
          example: 0
        click_count:
          type: integer
          description: The count of times links in the email were clicked.
          example: 0
        hard_bounce_count:
          type: integer
          description: The count of hard bounces for the email.
          example: 13
        soft_bounce_count:
          type: integer
          description: The count of soft bounces for the email.
          example: 1
    view-email-campaign-history:
      type: object
      properties:
        http_code:
          type: integer
          description: The HTTP status code of the response.
          example: 200
        response_code:
          type: string
          description: The response code indicating the status of the operation.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: Here is your result.
        data:
          allOf:
            - $ref: '#/components/schemas/pagination'
            - type: object
              properties:
                data:
                  type: array
                  items:
                    $ref: '#/components/schemas/email_campaign_history'
                  example:
                    - email_campaign_id: 77
                      from_name: test name
                      from_address: '4'
                      to_name: test2@test.com
                      to_address: test2@test.com
                      contact_id: 669105
                      subject: test subject
                      message_id: 7CB3227C-7F8C-4A72-A0CB-36283236D99F
                      processed_at: null
                      status: SpamReport
                      open_count: 0
                      click_count: 0
                      hard_bounce_count: 13
                      soft_bounce_count: 1
                    - email_campaign_id: 77
                      from_name: test name
                      from_address: '4'
                      to_name: test2@test.com
                      to_address: test2@test.com
                      contact_id: 669105
                      subject: test subject
                      message_id: 603C5349-5A24-40B4-89ED-F7619F7CC8A3
                      processed_at: null
                      status: null
                      open_count: 0
                      click_count: 0
                      hard_bounce_count: 0
                      soft_bounce_count: 0
                    - email_campaign_id: 77
                      from_name: test name
                      from_address: '4'
                      to_name: test2@test.com
                      to_address: test2@test.com
                      contact_id: 669105
                      subject: test subject
                      message_id: 5C5C0918-B263-42AA-8B5D-9E8ACECC0C64
                      processed_at: null
                      status: null
                      open_count: 0
                      click_count: 0
                      hard_bounce_count: 0
                      soft_bounce_count: 0
    master_email_template:
      type: object
      properties:
        template_id_master:
          type: integer
          description: The unique identifier for the template.
          example: 57
        template_name:
          type: string
          description: The name of the template.
          example: Welcome Email
        date_added:
          type: string
          description: The date the template was added.
          example: '1436157486'
        body:
          type: string
          nullable: true
          description: The body of the template.
          example: |-
            <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" ...
                                 </tr>
                              </tbody>
                           </table>
                        </td>
                     </tr>
                  </tbody>
               </table>
            </body>
            </html>
        thumbnail:
          type: object
          properties:
            small:
              type: string
              description: The small thumbnail of the template.
              example: >-
                https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_email-marketing/_templates-master/basic2/thumb-small.jpg
            large:
              type: string
              description: The large thumbnail of the template.
              example: >-
                https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_email-marketing/_templates-master/basic2/thumb-large.jpg
    view-master-email-templates:
      type: object
      properties:
        http_code:
          type: integer
          description: The HTTP status code of the response.
          example: 200
        response_code:
          type: string
          description: The response code indicating the status of the operation.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: List of Email Master Templates
        data:
          type: array
          items:
            $ref: '#/components/schemas/master_email_template'
          example:
            - template_id_master: 57
              template_name: Welcome Email
              date_added: '1436157486'
              thumbnail:
                small: >-
                  https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_email-marketing/_templates-master/basic2/thumb-small.jpg
                large: >-
                  https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_email-marketing/_templates-master/basic2/thumb-large.jpg
            - template_id_master: 1
              template_name: Minty
              date_added: '1445848821'
              thumbnail:
                small: >-
                  https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_email-marketing/_templates-master/minty/thumb-small.jpg
                large: >-
                  https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_email-marketing/_templates-master/minty/thumb-large.jpg
    view-master-email-template:
      type: object
      properties:
        http_code:
          type: integer
          description: The HTTP status code of the response.
          example: 200
        response_code:
          type: string
          description: The response code indicating the status of the operation.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: Here is your email template
        data:
          $ref: '#/components/schemas/master_email_template'
    view-template-categories:
      type: object
      properties:
        http_code:
          type: integer
          description: The HTTP status code of the response.
          example: 200
        response_code:
          type: string
          description: The response code indicating the status of the operation.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: List of Email Categories
        data:
          type: array
          items:
            properties:
              category_id:
                type: number
                example: 1
                description: The ID of the category.
              category_name:
                type: string
                example: Art
                description: The name of the category.
          example:
            - category_id: 2
              category_name: Alerts/Notificartions
            - category_id: 3
              category_name: Art
            - category_id: 4
              category_name: Birthday
            - category_id: 23
              category_name: Blank Template
    view-template-category:
      type: object
      properties:
        http_code:
          type: integer
          description: The HTTP status code of the response.
          example: 200
        response_code:
          type: string
          description: The response code indicating the status of the operation.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: Here are your data.
        data:
          type: object
          properties:
            category_id:
              type: number
              example: 4
              description: The ID of the category.
            name:
              type: string
              example: Birthday
              description: The name of the category.
    view-templates-in-category:
      type: object
      properties:
        http_code:
          type: integer
          description: The HTTP status code of the response.
          example: 200
        response_code:
          type: string
          description: The response code indicating the status of the operation.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: List of Email Templates By Category
        data:
          type: array
          items:
            $ref: '#/components/schemas/master_email_template'
          example:
            - template_id_master: 1
              category_id: 1
              template_name: Minty
              body: >-
                <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
                ...
                                     </tr>
                                  </tbody>
                               </table>
                            </td>
                         </tr>
                      </tbody>
                   </table>
                </body>

                </html>
              date_added: '1445848821'
              thumbnail:
                small: >-
                  https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_email-marketing/_templates-master/basic2/thumb-small.jpg
                large: >-
                  https://s3-ap-southeast-2.amazonaws.com/clicksend-api-downloads/_email-marketing/_templates-master/basic2/thumb-large.jpg
    view-email-templates:
      type: object
      properties:
        http_code:
          type: integer
          description: The HTTP status code of the response.
          example: 200
        response_code:
          type: string
          description: The response code indicating the status of the operation.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: Here are your email templates.
        data:
          type: object
          properties:
            total:
              type: integer
              example: 2
              description: The total number of records in the response.
            per_page:
              type: integer
              example: 15
              description: The number of records per page.
            current_page:
              type: integer
              example: 1
              description: The current page number.
            last_page:
              type: integer
              example: 1
              description: The last page number.
            next_page_url:
              type: string
              nullable: true
              description: The URL of the next page of records.
              example: null
            prev_page_url:
              type: string
              nullable: true
              description: The URL of the previous page of records.
              example: null
            from:
              type: integer
              example: 1
              description: The index of the first record in the page.
            to:
              type: integer
              example: 15
              description: The index of the last record in the page.
            data:
              type: array
              items:
                type: object
                properties:
                  template_id:
                    type: integer
                    description: The ID of the email template.
                  template_name:
                    type: string
                    description: The name of the email template.
              example:
                - template_id: 281
                  template_name: Test
                - template_id: 290
                  template_name: Minions
    user_email_template:
      type: object
      properties:
        template_id:
          type: integer
          description: The unique identifier for the template.
          example: 292
        template_id_master:
          type: integer
          description: The unique identifier for the template.
          example: 57
        template_name:
          type: string
          description: The name of the template.
          example: new minion template!
        body:
          type: string
          description: The body of the template.
          example: >-
            <div id="nb_wrapper"><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
            Transitional//EN"...
    create-email-template:
      type: object
      properties:
        http_code:
          type: integer
          description: The HTTP status code of the response.
          example: 200
        response_code:
          type: string
          description: The response code indicating the status of the operation.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: New email template has been saved.
        data:
          $ref: '#/components/schemas/user_email_template'
    view-email-template:
      type: object
      properties:
        http_code:
          type: integer
          description: The HTTP status code of the response.
          example: 200
        response_code:
          type: string
          description: The response code indicating the status of the operation.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: Here is your email template.
        data:
          $ref: '#/components/schemas/user_email_template'
    update-email-template:
      type: object
      properties:
        http_code:
          type: integer
          description: The HTTP status code of the response.
          example: 200
        response_code:
          type: string
          description: The response code indicating the status of the operation.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: Your email template has been updated.
        data:
          $ref: '#/components/schemas/user_email_template'
    delete-email-template:
      type: object
      properties:
        http_code:
          type: integer
          description: The HTTP status code of the response.
          example: 200
        response_code:
          type: string
          description: The response code indicating the status of the operation.
          example: SUCCESS
        response_msg:
          type: string
          description: A message describing the outcome of the operation.
          example: Your email template has been deleted.
        data:
          type: array
          items: []
          example: []
paths:
  /v3/email/send:
    post:
      summary: Send Email
      operationId: send-email
      description: >-
        _Send transactional email_


        Send transactional email


        ### Properties


        | Name | Type | Required | Restrictions | Description |

        | --- | --- | --- | --- | --- |

        | to | array | true | none | Array of To Recipient items. (array of
        names and emails) |

        | cc | array | false | none | Array of Cc Recipient items. (array of
        names and emails) |

        | bcc | array | false | none | Array of Bcc Recipient items. (array of
        names and emails) |

        | from | object | true | none | From Email object. (object containing
        name and email) |

        | body | string | true | none | Body of the email. |

        | attachments | array | false | none | Array of Attachment items. |

        | schedule | number | false | none | Schedule. |

        | name | string | false | none | Name of person email belongs to |

        | email | string | true | none | Email to be used. |

        | content | string | true | none | The base64-encoded contents of the
        file. |

        | type | string | true | none | The type of file being attached. |

        | filename | string | true | none | The name of the file being attached.
        |

        | disposition | string | true | none | Inline for content that can be
        displayed within the email, or attachment for any other files. |

        | content_id | string | true | none | An ID for the content. |



        Refer to [Status Codes](/#status-codes) for definitions of HTTP status
        code responses.



        <div style="background-color: #FF6A4B; padding: 10px; border-radius:
        8px;">
          <span style="color: white;">This endpoint requires authentication,</span> 
          <a href="/#authentication" style="color: white; text-decoration: underline;">more info...</a>
        </div>
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                to:
                  type: array
                  items:
                    type: object
                    properties:
                      email:
                        type: string
                      name:
                        type: string
                from:
                  type: object
                  properties:
                    email_address_id:
                      type: string
                    name:
                      type: string
                subject:
                  type: string
                body:
                  type: string
                attachments:
                  type: array
                  items:
                    type: object
                    properties:
                      content:
                        type: string
                      type:
                        type: string
                      filename:
                        type: string
                      disposition:
                        type: string
                      content_id:
                        type: string
              example:
                to:
                  - email: test@test.com
                    name: test from
                from:
                  email_address_id: '{{addressId}}'
                  name: test
                subject: test subject
                body: test body
                attachments:
                  - content: '{{base64EncodedImageFile}}'
                    type: image/jpeg
                    filename: test.jpg
                    disposition: inline
                    content_id: test
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/send-email'
      x-codeSamples:
        - lang: curl
          source: |-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
                 --request POST \
                 --header "Content-Type: application/json" \
                 --data-binary "    {
                   \"to\":[
                      {
                         \"email\":\"test@clicksend.com\",
                         \"name\":\"John Doe\"
                      }
                   ],
                   \"cc\":[
                      {
                         \"email\":\"test2@clicksend.com\",
                         \"name\":\"Jane Doe\"
                      }
                   ],
                   \"bcc\":[
                      {
                         \"email\":\"test3@clicksend.com\",
                         \"name\":\"Joseph Doe\"
                      }
                   ],
                   \"from\":{
                      \"email_address_id\":1,
                      \"name\":\"Joanne Doe\"
                   },
                   \"subject\":\"Test subject\",
                   \"body\":\"Lorem ipsum\",
                   \"attachments\":[
                      {
                         \"content\":\"ZmlsZSBjb250ZW50cw==\",
                         \"type\":\"text/plain\",
                         \"filename\":\"text.txt\",
                         \"disposition\":\"attachment\",
                         \"content_id\":\"text\"
                      }
                   ]
                }" \
            'https://rest.clicksend.com/v3/email/send'
        - lang: PHP
          source: >-
            <?php

            require_once(__DIR__ . '/vendor/autoload.php');


            // Configure HTTP basic authorization: BasicAuth

            $config = ClickSend\Configuration::getDefaultConfiguration()
                          ->setUsername('USERNAME')
                          ->setPassword('API_KEY');

            $apiInstance = new ClickSend\Api\TransactionalEmailApi(new
            GuzzleHttp\Client(),$config);

            $email = new \ClickSend\Model\Email(); // \ClickSend\Model\Email |
            Email model

            $email_recipient=new \ClickSend\Model\EmailRecipient();

            $email_recipient->setEmail("test@clicksend.com");

            $email_recipient->setName("John Doe");

            $email_from=new \ClickSend\Model\EmailFrom();

            $email_from->setEmailAddressId(4366);

            $email_from->setName("Joanne Doe");

            $attachment = new \ClickSend\Model\Attachment();

            $attachment->setContent("ZmlsZSBjb250ZW50cw==");

            $attachment->setType("text/plain");

            $attachment->setFilename("text.txt");

            $attachment->setDisposition("attachment");

            $attachment->setContentId("text");

            $email->setTo([$email_recipient]);

            $email->setFrom($email_from);

            $email->setSubject("Test subject");

            $email->setBody("Lorem ipsum");


            try {
                $result = $apiInstance->emailSendPost($email);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling TransactionalEmailApi->emailSendPost: ', $e->getMessage(), PHP_EOL;
            }

            ?>
        - lang: C#
          source: >-
            var transactionalEmailApi = new
            TransactionalEmailApi(configuration);

            var listOfRecipients = new List<EmailRecipient>();

            listOfRecipients.Add(new EmailRecipient(
                email: "john@doe.com",
                name: "John Doe"
            ));

            var listOfCC = new List<EmailRecipient>();

            listOfCC.Add(new EmailRecipient(
                email: "john@doe.com",
                name: "John Doe"
            ));

            var listOfBCC = new List<EmailRecipient>();

            listOfBCC.Add(new EmailRecipient(
                email: "john@doe.com",
                name: "John Doe"
            ));

            var listOfAttachments = new List<Attachment>();

            listOfAttachments.Add(new Attachment(
                content: "content",
                type: "type",
                filename: "filename",
                disposition: "disposition",
                contentId: "contentId"
            ));

            var emailFrom = new EmailFrom(
                emailAddressId: FROM_EMAIL_ID_GOES,
                name: "John Doe"
            );

            var response = transactionalEmailApi.EmailSendPost(new Email(
                to: listOfRecipients,
                cc: listOfCC,
                bcc: listOfBCC,
                from: emailFrom,
                subject: "Test Subject",
                body: "Test Body",
                attachments: listOfAttachments
            ));
        - lang: Java
          source: |-
            package ClickSend;

            import java.math.BigDecimal;
            import java.util.Arrays;
            import java.util.List;
            import ClickSend.Api.TransactionalEmailApi;
            import ClickSend.Model.Attachment;
            import ClickSend.Model.Email;
            import ClickSend.Model.EmailFrom;
            import ClickSend.Model.EmailRecipient;

            public class send_email {
              public static void main(String[] args) {
                ApiClient defaultClient = new ApiClient();
                defaultClient.setUsername("USERNAME");
                defaultClient.setPassword("API_KEY");
                TransactionalEmailApi apiInstance = new TransactionalEmailApi(defaultClient);
                EmailRecipient emailRecipient=new EmailRecipient();
                emailRecipient.email("example@gmail.com");
                emailRecipient.name("abc");
                List<EmailRecipient> emailRecipientList=Arrays.asList(emailRecipient);
                EmailFrom emailFrom=new EmailFrom();
                emailFrom.emailAddressId("4197");
                emailFrom.name("abc");
                Attachment attachment= new Attachment();
                attachment.content("ZmlsZSBjb250ZW50cw==");
                attachment.contentId("text");
                attachment.disposition("attachment");
                attachment.type("text/plain");
                attachment.filename("text.txt");
                List<Attachment> attachmentList=Arrays.asList(attachment);
                Email email = new Email(); // Email | Email model
                email.to(emailRecipientList);
                email.cc(emailRecipientList);
                email.bcc(emailRecipientList);
                email.from(emailFrom);
                email.subject("subject");
                email.body("body");
                email.attachments(attachmentList);
                email.schedule(new BigDecimal(147258369));
                try {
                    String result = apiInstance.emailSendPost(email);
                    System.out.println(result);
                } catch (ApiException e) {
                    System.err.println("Exception when calling TransactionalEmailApi#emailSendPost");
                    e.printStackTrace();
                }
              }
            }
        - lang: Node.js
          source: >-
            var api = require('./api.js');


            var emailTransactionalApi = new
            api.TransactionalEmailApi("USERNAME", "API_KEY");


            var emailRecipient = new api.EmailRecipient();


            emailRecipient.email = "test@clicksend.com";

            emailRecipient.name = "John doe";


            var emailFrom = new api.EmailFrom();


            emailFrom.emailAddressId = 4197;

            emailFrom.name = "john";


            var attachment = new api.Attachment();


            attachment.content = "ZmlsZSBjb250ZW50cw==";

            attachment.type = "text/plain";

            attachment.filename = "text.txt";

            attachment.disposition = "attachment";

            attachment.contentId = "text";


            var email = new api.Email();


            email.to = [emailRecipient];

            email.cc = [emailRecipient];

            email.bcc = [emailRecipient];

            email.from = emailFrom;

            email.subject = "subject";

            email.body = "body";

            email.attachments = [attachment];


            emailTransactionalApi.emailSendPost(email).then(function(response) {
              console.log(response.body);
            }).catch(function(err){
              console.error(err.body);
            });
        - lang: Ruby
          source: |-
            # load the gem
            require 'clicksend_client'
            require 'json'

            # setup authorization
            ClickSendClient.configure do |config|
              # Configure HTTP basic authorization: BasicAuth
              config.username = 'USERNAME'
              config.password = 'API_KEY'
            end

            api_instance = ClickSendClient::TransactionalEmailApi.new

            email = ClickSendClient::Email.new # Email | Email model

            email.to = [
              ClickSendClient::EmailRecipient.new("name": "name", "email": "email"),
              ClickSendClient::EmailRecipient.new("name": "name", "email": "email")
            ]

            email.cc = [
              ClickSendClient::EmailRecipient.new("name": "name", "email": "email"),
              ClickSendClient::EmailRecipient.new("name": "name", "email": "email")
            ]

            email.bcc = [
              ClickSendClient::EmailRecipient.new("name": "name", "email": "email"),
              ClickSendClient::EmailRecipient.new("name": "name", "email": "email")
            ]

            email.from = ClickSendClient::EmailFrom.new(
              "name": "name",
              "email_address_id": 56
            )

            email.attachments = [
              ClickSendClient::Attachment.new(
                "disposition": "attachment",
                "filename": "text.txt",
                "content_id": "text",
                "type": "text/plain",
                "content": "ZmlsZSBjb250ZW50cw=="
              ),
              ClickSendClient::Attachment.new(
                "disposition": "attachment",
                "filename": "text2.txt",
                "content_id": "text2",
                "type": "text/plain",
                "content": "ZmlsZSBjb250ZW50cw=="
              )
            ]

            email.subject = "Subject"

            email.body = "Lorem ipsum"

            begin
              # Send transactional email
              result = api_instance.email_send_post(email)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling TransactionalEmailApi->email_send_post: #{e.response_body}"
            end
        - lang: Python
          source: >-
            from __future__ import print_function

            import clicksend_client

            from clicksend_client.rest import ApiException

            from clicksend_client import EmailRecipient

            from clicksend_client import EmailFrom

            from clicksend_client import Attachment


            # Configure HTTP basic authorization: BasicAuth

            configuration = clicksend_client.Configuration()

            configuration.username = 'USERNAME'

            configuration.password = 'API_KEY'


            # create an instance of the API class

            api_instance =
            clicksend_client.TransactionalEmailApi(clicksend_client.ApiClient(configuration))

            email_receipient=EmailRecipient(email='example@gmail.com',name='abc')

            email_from=EmailFrom(email_address_id='4197',name='abc')

            attachment=Attachment(content='ZmlsZSBjb250ZW50cw==',
                                  type='text/plain',
                                  filename='text.txt',
                                  disposition='attachment',
                                  content_id='text')
            # Email | Email model

            email = clicksend_client.Email(to=[email_receipient],
                                          cc=[email_receipient],
                                          bcc=[email_receipient],
                                          _from=email_from,
                                          subject="Test subject",
                                          body="this is body",
                                          attachments=[attachment],
                                          schedule=14785562325) 

            try:
                # Send transactional email
                api_response = api_instance.email_send_post(email)
                print(api_response)
            except ApiException as e:
                print("Exception when calling TransactionalEmailApi->email_send_post: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::TransactionalEmailApi;

            use WWW::ClickSendClient::Object::Email;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


            my $api = WWW::ClickSendClient::TransactionalEmailApi->new(username
            => $username, password => $password);


            my %params = (
                'to' => [
                    {
                        'name'  => 'test1',
                        'email' => 'test1@test.com',
                    },
                    {
                        'name'  => 'test3',
                        'email' => 'test3@test.com',
                    }
                ],
                'cc' => [
                    {
                        'name'  => 'test2',
                        'email' => 'test2@test.com',
                    }
                ],
                'bcc' => [
                    {
                        'name'  => 'test3',
                        'email' => 'test3@test.com',
                    }
                ],
                'from' => [
                    {
                        'name'  => 'test3',
                        'email' => 'test3@test.com',
                    }
                ],
                'body'                  => 'body',
                'subject'               => 'this is subject',
                'from.email_address_id' => '1233',
                'from.name'             => 'From NAME'
            );


            my $email_obj = WWW::ClickSendClient::Object::Email->new(%params);


            my $json_output = $api->email_send_post('email' => $email_obj);


            print $json_output;
        - lang: objc
          source: >-
            #import "CSTransactionalEmailApi.h"

            #import "CSDefaultConfiguration.h"


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

            // Configure HTTP basic authorization (authentication scheme:
            BasicAuth)

            [apiConfig setUsername:@"USERNAME"];

            [apiConfig setPassword:@"PASSWORD"];


            CSEmailRecipient *emailRecipient = [[CSEmailRecipient alloc] init];

            emailRecipient.email = @"email";

            emailRecipient.name = @"name";


            CSEmailRecipient *ccRecipient = [[CSEmailRecipient alloc] init];

            ccRecipient.email = @"email";

            ccRecipient.name = @"name";


            CSEmailFrom *emailFrom = [[CSEmailFrom alloc] init];

            emailFrom.emailAddressId = @"email_addr_id";

            emailFrom.name = @"name";


            CSEmail *email = [[CSEmail alloc] init];

            email.to = [[NSArray alloc] initWithObjects:emailRecipient, nil];

            email.cc = [[NSArray alloc] initWithObjects:ccRecipient, nil];

            email.from = emailFrom;

            email.body = @"body";


            CSTransactionalEmailApi *transEmailApi = [[CSTransactionalEmailApi
            alloc] init];

            [transEmailApi emailSendPostWithEmail:email
            completionHandler:^(NSString *output, NSError *error) {
                if (error) {
                    NSLog(@"Error: %@", error);
                } else {
                    NSLog(@"%@", output);
                }
            }];
        - lang: swift
          source: >-
            import Alamofire

            if let authHeader = Request.authorizationHeader(user: "USERNAME",
            password: "PASSWORD") {

            ClickSendClientAPI.customHeaders = [authHeader.key :
            authHeader.value]

            }


            let emailRecipient = EmailRecipient(
                email: "email", 
                name: "name"
            )

            let ccRecipient = EmailRecipient(
                email: "email",
                name: "name"
            )

            let emailFrom = EmailFrom(
                emailAddressId: "email_address_id", 
                name: "name"
            )


            let email = Email(
                to: [emailRecipient], 
                cc: [ccRecipient], 
                bcc: nil, 
                from: emailFrom, 
                subject: "subject", 
                body: "body", 
                attachments: nil, 
                schedule: nil
            )


            TransactionalEmailAPI.emailSendPost(email: email) { (dataString,
            error) in
                if let error = error {
                    print(error)
                } else {
                    if let data = dataString!.data(using: String.Encoding.utf8) {
                        do {
                            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                                print(dictonary)
                            } else {
                                print("bad json")
                            }
                            } catch let error as NSError {
                            print(error)
                        }
                    }
                }
            }
  /v3/email/price:
    post:
      summary: Calculate Email Price
      operationId: calculate-email-price
      description: >-
        _Get transactional email price_


        Get transactional email price


        ### Properties


        | Name | Type | Required | Restrictions | Description |

        | --- | --- | --- | --- | --- |

        | to | array | true | none | Array of To Recipient items. (array of
        names and emails) |

        | cc | array | false | none | Array of Cc Recipient items. (array of
        names and emails) |

        | bcc | array | false | none | Array of Bcc Recipient items. (array of
        names and emails) |

        | from | object | true | none | From Email object. (object containing
        name and email) |

        | body | string | true | none | Body of the email. |

        | attachments | array | false | none | Array of Attachment items. |

        | schedule | number | false | none | Schedule. |

        | name | string | false | none | Name of person email belongs to |

        | email | string | true | none | Email to be used. |

        | content | string | true | none | The base64-encoded contents of the
        file. |

        | type | string | true | none | The type of file being attached. |

        | filename | string | true | none | The name of the file being attached.
        |

        | disposition | string | true | none | Inline for content that can be
        displayed within the email, or attachment for any other files. |

        | content_id | string | true | none | An ID for the content. |



        Refer to [Status Codes](/#status-codes) for definitions of HTTP status
        code responses.



        <div style="background-color: #FF6A4B; padding: 10px; border-radius:
        8px;">
          <span style="color: white;">This endpoint requires authentication,</span> 
          <a href="/#authentication" style="color: white; text-decoration: underline;">more info...</a>
        </div>
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                to:
                  type: array
                  items:
                    type: object
                    properties:
                      email:
                        type: string
                      name:
                        type: string
                from:
                  type: object
                  properties:
                    email_address_id:
                      type: string
                    name:
                      type: string
                subject:
                  type: string
                body:
                  type: string
              example:
                to:
                  - email: test@test.com
                    name: test from
                from:
                  email_address_id: '{{addressId}}'
                  name: test
                subject: test subject
                body: test body
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/calculate-email-price'
      x-codeSamples:
        - lang: PHP
          source: >-
            <?php

            require_once(__DIR__ . '/vendor/autoload.php');


            // Configure HTTP basic authorization: BasicAuth

            $config = ClickSend\Configuration::getDefaultConfiguration()
                        ->setUsername('USERNAME')
                        ->setPassword('API_KEY');

            $apiInstance = new ClickSend\Api\TransactionalEmailApi(new
            GuzzleHttp\Client(),$config);


            $email = new \ClickSend\Model\Email(); // \ClickSend\Model\Email |
            Email model

            $email_recipient=new \ClickSend\Model\EmailRecipient();

            $email_recipient->setEmail("test@clicksend.com");

            $email_recipient->setName("John Doe");

            $email_from=new \ClickSend\Model\EmailFrom();

            $email_from->setEmailAddressId(4366);

            $email_from->setName("Joanne Doe");

            $attachment= new \ClickSend\Model\Attachment();

            $attachment->setContent("ZmlsZSBjb250ZW50cw==");

            $attachment->setType("text/plain");

            $attachment->setFilename("text.txt");

            $attachment->setDisposition("attachment");

            $attachment->setContentId("text");

            $email->setTo([$email_recipient]);

            $email->setFrom($email_from);

            $email->setSubject("Test subject");

            $email->setBody("Lorem ipsum");


            try {
                $result = $apiInstance->emailPricePost($email);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling TransactionalEmailApi->emailPricePost: ', $e->getMessage(), PHP_EOL;
            }

            ?>
        - lang: C#
          source: >-
            using IO.ClickSend.ClickSend.Api;

            using IO.ClickSend.Client;

            using IO.ClickSend.ClickSend.Model;


            var configuration = new Configuration()

            {
                Username = USERNAME,
                Password = API_KEY
            }; 

            var transactionalEmailApi = new
            TransactionalEmailApi(configuration);

            var listOfRecipients = new List<EmailRecipient>();

            listOfRecipients.Add(new EmailRecipient(
                email: "john@doe.com",
                name: "John Doe"
            ));

            var listOfCC = new List<EmailRecipient>();

            listOfCC.Add(new EmailRecipient(
                email: "john@doe.com",
                name: "John Doe"
            ));

            var listOfBCC = new List<EmailRecipient>();

            listOfBCC.Add(new EmailRecipient(
                email: "john@doe.com",
                name: "John Doe"
            ));

            var listOfAttachments = new List<Attachment>();

            listOfAttachments.Add(new Attachment(
                content: "content",
                type: "type",
                filename: "filename",
                disposition: "disposition",
                contentId: "contentId"
            ));

            var emailFrom = new EmailFrom(
                emailAddressId: FROM_EMAIL_ID_GOES,
                name: "John Doe"
            );

            var response = transactionalEmailApi.EmailPricePost(new Email(
                to: listOfRecipients,
                cc: listOfCC,
                bcc: listOfBCC,
                from: emailFrom,
                subject: "Test Subject",
                body: "Test Body",
                attachments: listOfAttachments
            ));
        - lang: Java
          source: |-
            package ClickSend;

            import java.math.BigDecimal;
            import java.util.Arrays;
            import java.util.List;
            import ClickSend.Api.TransactionalEmailApi;
            import ClickSend.Model.Attachment;
            import ClickSend.Model.Email;
            import ClickSend.Model.EmailFrom;
            import ClickSend.Model.EmailRecipient;

            public class calculate_email_price {
              public static void main(String[] args) {
                ApiClient defaultClient = new ApiClient();
                defaultClient.setUsername("USERNAME");
                defaultClient.setPassword("API_KEY");
                TransactionalEmailApi apiInstance = new TransactionalEmailApi(defaultClient);
                EmailRecipient emailRecipient=new EmailRecipient();
                emailRecipient.email("example@gmail.com");
                emailRecipient.name("abc");
                List<EmailRecipient> emailRecipientList=Arrays.asList(emailRecipient);
                EmailFrom emailFrom=new EmailFrom();
                emailFrom.emailAddressId("4197");
                emailFrom.name("abc");
                Attachment attachment= new Attachment();
                attachment.content("ZmlsZSBjb250ZW50cw==");
                attachment.contentId("text");
                attachment.disposition("attachment");
                attachment.type("text/plain");
                attachment.filename("text.txt");
                List<Attachment> attachmentList=Arrays.asList(attachment);
                Email email = new Email(); // Email | Email model
                email.to(emailRecipientList);
                email.cc(emailRecipientList);
                email.bcc(emailRecipientList);
                email.from(emailFrom);
                email.subject("subject");
                email.body("body");
                email.attachments(attachmentList);
                email.schedule(new BigDecimal(147258369));
                try {
                    String result = apiInstance.emailPricePost(email);
                    System.out.println(result);
                } catch (ApiException e) {
                    System.err.println("Exception when calling TransactionalEmailApi#emailPricePost");
                    e.printStackTrace();
                }
              }
            }
        - lang: Node.js
          source: >-
            var api = require('./api.js');


            var emailTransactionalApi = new
            api.TransactionalEmailApi("USERNAME", "API_KEY");


            var emailRecipient = new api.EmailRecipient();


            emailRecipient.email = "test@clicksend.com";

            emailRecipient.name = "John doe";


            var emailFrom = new api.EmailFrom();


            emailFrom.emailAddressId = 4197;

            emailFrom.name = "john";


            var attachment = new api.Attachment();

            attachment.content = "ZmlsZSBjb250ZW50cw==";

            attachment.type = "text/plain";

            attachment.filename = "text.txt";

            attachment.disposition = "attachment";

            attachment.contentId = "text";


            var email = new api.Email();


            email.to = [emailRecipient];

            email.cc = [emailRecipient];

            email.bcc = [emailRecipient];

            email.from = emailFrom;

            email.subject = "subject";

            email.body = "body";

            email.attachments = [attachment];


            emailTransactionalApi.emailPricePost(email).then(function(response)
            {
              console.log(response.body);
            }).catch(function(err){
              console.error(err.body);
            });
        - lang: Ruby
          source: |-
            # load the gem
            require 'clicksend_client'
            require 'json'

            # setup authorization
            ClickSendClient.configure do |config|
              # Configure HTTP basic authorization: BasicAuth
              config.username = 'USERNAME'
              config.password = 'API_KEY'
            end

            api_instance = ClickSendClient::TransactionalEmailApi.new

            email = ClickSendClient::Email.new # Email | Email model

            email.to = [
              ClickSendClient::EmailRecipient.new("name": "name", "email": "email"),
              ClickSendClient::EmailRecipient.new("name": "name", "email": "email")
            ]

            email.cc = [
              ClickSendClient::EmailRecipient.new("name": "name", "email": "email"),
              ClickSendClient::EmailRecipient.new("name": "name", "email": "email")
            ]

            email.bcc = [
              ClickSendClient::EmailRecipient.new("name": "name", "email": "email"),
              ClickSendClient::EmailRecipient.new("name": "name", "email": "email")
            ]

            email.from = ClickSendClient::EmailFrom.new(
              "name": "name",
              "email_address_id": 56
            )

            email.attachments = [
              ClickSendClient::Attachment.new(
                "disposition": "attachment",
                "filename": "text.txt",
                "content_id": "text",
                "type": "text/plain",
                "content": "ZmlsZSBjb250ZW50cw=="
              ),
              ClickSendClient::Attachment.new(
                "disposition": "attachment",
                "filename": "text2.txt",
                "content_id": "text2",
                "type": "text/plain",
                "content": "ZmlsZSBjb250ZW50cw=="
              )
            ]

            email.subject = "Subject"

            email.body = "Lorem ipsum"

            begin
              # Get transactional email price
              result = api_instance.email_price_post(email)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling TransactionalEmailApi->email_price_post: #{e.response_body}"
            end
        - lang: Python
          source: >-
            from __future__ import print_function

            import clicksend_client

            from clicksend_client.rest import ApiException

            from clicksend_client import EmailRecipient

            from clicksend_client import EmailFrom

            from clicksend_client import Attachment


            # Configure HTTP basic authorization: BasicAuth

            configuration = clicksend_client.Configuration()

            configuration.username = 'USERNAME'

            configuration.password = 'API_KEY'


            # create an instance of the API class

            api_instance =
            clicksend_client.TransactionalEmailApi(clicksend_client.ApiClient(configuration))

            email_receipient=EmailRecipient(email='example@gmail.com',name='abc')

            email_from=EmailFrom(email_address_id='4197',name='abc')

            attachment=Attachment(content='ZmlsZSBjb250ZW50cw==',
                                  type='text/plain',
                                  filename='text.txt',
                                  disposition='attachment',
                                  content_id='text')
            # Email | Email model

            email = clicksend_client.Email(to=[email_receipient],
                                          cc=[email_receipient],
                                          bcc=[email_receipient],
                                          _from=email_from,
                                          subject="Test subject",
                                          body="this is body",
                                          attachments=[attachment],
                                          schedule=14785562325) 

            try:
                # Get transactional email price
                api_response = api_instance.email_price_post(email)
                print(api_response)
            except ApiException as e:
                print("Exception when calling TransactionalEmailApi->email_price_post: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::TransactionalEmailApi;

            use WWW::ClickSendClient::Object::Email;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


            my $api = WWW::ClickSendClient::TransactionalEmailApi->new(username
            => $username, password => $password);


            my %params = (
                'to' => [
                    {
                        'name'  => 'test1',
                        'email' => 'test1@test.com',
                    },
                    {
                        'name'  => 'test3',
                        'email' => 'test3@test.com',
                    }
                ],
                'cc' => [
                    {
                        'name'  => 'test2',
                        'email' => 'test2@test.com',
                    }
                ],
                'bcc' => [
                    {
                        'name'  => 'test3',
                        'email' => 'test3@test.com',
                    }
                ],
                'from' => [
                    {
                        'name'  => 'test3',
                        'email' => 'test3@test.com',
                    }
                ],
                'body'                  => 'body',
                'subject'               => 'this is subject',
                'from.email_address_id' => '1233',
                'from.name'             => 'From NAME'
            );


            my $email_obj = WWW::ClickSendClient::Object::Email->new(%params);


            my $json_output = $api->email_price_post('email' => $email_obj);


            print $json_output;
        - lang: objc
          source: >-
            #import "CSTransactionalEmailApi.h"

            #import "CSDefaultConfiguration.h"


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

            // Configure HTTP basic authorization (authentication scheme:
            BasicAuth)

            [apiConfig setUsername:@"USERNAME"];

            [apiConfig setPassword:@"PASSWORD"];


            CSEmailRecipient *emailRecipient = [[CSEmailRecipient alloc] init];

            emailRecipient.email = @"email";

            emailRecipient.name = @"name";


            CSEmailRecipient *ccRecipient = [[CSEmailRecipient alloc] init];

            ccRecipient.email = @"email";

            ccRecipient.name = @"name";


            CSEmailFrom *emailFrom = [[CSEmailFrom alloc] init];

            emailFrom.emailAddressId = @"email_addr_id";

            emailFrom.name = @"name";


            CSEmail *email = [[CSEmail alloc] init];

            email.to = [[NSArray alloc] initWithObjects:emailRecipient, nil];

            email.cc = [[NSArray alloc] initWithObjects:ccRecipient, nil];

            email.from = emailFrom;

            email.body = @"body";


            CSTransactionalEmailApi *transEmailApi = [[CSTransactionalEmailApi
            alloc] init];

            [transEmailApi emailPricePostWithEmail:email
            completionHandler:^(NSString *output, NSError *error) {
                if (error) {
                    NSLog(@"Error: %@", error);
                } else {
                    NSLog(@"%@", output);
                }
            }];
        - lang: swift
          source: >-
            import Alamofire

            if let authHeader = Request.authorizationHeader(user: "USERNAME",
            password: "PASSWORD") {
                ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
            }


            let emailRecipient = EmailRecipient(
                                    email: "email", 
                                    name: "name"
                                )
            let ccRecipient = EmailRecipient(
                                email: "email", 
                                name: "name"
                            )

            let emailFrom = EmailFrom(
                                emailAddressId: "email_address_id", 
                                name: "name"
                            )

            let email = Email(
                            to: [emailRecipient], 
                            cc: [ccRecipient], 
                            bcc: nil, from: 
                            emailFrom, 
                            subject: "subject", 
                            body: "body", 
                            attachments: nil, 
                            schedule: nil
                        )

            TransactionalEmailAPI.emailPricePost(email: email) { (dataString,
            error) in
                if let error = error {
                    print(error)
                } else {
                    if let data = dataString!.data(using: String.Encoding.utf8) {
                        do {
                            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                                print(dictonary)
                            } else {
                                print("bad json")
                            }
                        } catch let error as NSError {
                            print(error)
                        }
                    }
                }
            }
  /v3/email/history:
    get:
      summary: View Email History
      operationId: view-email-history
      description: >-
        _Get all transactional email history_


        Get all transactional email history


        ### Parameters


        | Parameter | In | Type | Required | Description |

        | --- | --- | --- | --- | --- |

        | date_from | query | integer(int32) | false | Start date (Unix
        Timestamp e.g. 1436849372) |

        | date_to | query | integer(int32) | false | End date (Unix Timestamp
        e.g. 1436879372) |

        | page | query | integer(int32) | false | [Page number](/#pagination) |

        | limit | query | integer(int32) | false | [Number of records per
        page](/#pagination) |



        Refer to [Status Codes](/#status-codes) for definitions of HTTP status
        code responses.



        <div style="background-color: #FF6A4B; padding: 10px; border-radius:
        8px;">
          <span style="color: white;">This endpoint requires authentication,</span> 
          <a href="/#authentication" style="color: white; text-decoration: underline;">more info...</a>
        </div>
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/view-email-history'
      x-codeSamples:
        - lang: curl
          source: |-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
            'https://rest.clicksend.com/v3/email/history'
        - lang: PHP
          source: >-
            <?php

            require_once(__DIR__ . '/vendor/autoload.php');


            // Configure HTTP basic authorization: BasicAuth

            $config = ClickSend\Configuration::getDefaultConfiguration()
                          ->setUsername('USERNAME')
                          ->setPassword('API_KEY');

            $apiInstance = new ClickSend\Api\TransactionalEmailApi(new
            GuzzleHttp\Client(),$config);

            $date_from = '1436849372'; // int | Start date

            $date_to = '1436879372'; // int | End date

            $page = 1; // int | Page number

            $limit = 10; // int | Number of records per page


            try {
                $result = $apiInstance->emailHistoryGet($date_from, $date_to, $page, $limit);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling TransactionalEmailApi->emailHistoryGet: ', $e->getMessage(), PHP_EOL;
            }

            ?>
        - lang: C#
          source: >-
            using IO.ClickSend.ClickSend.Api;

            using IO.ClickSend.Client;

            using IO.ClickSend.ClickSend.Model;


            var configuration = new Configuration()

            {
                Username = USERNAME, 
                Password = API_KEY  
            };

            var transactionalEmailApi = new
            TransactionalEmailApi(configuration);


            var dateFrom = '1546913229';

            var dateTo = '1546923229';

            var page = 1;

            var limit = 10;


            var response = transactionalEmailApi.EmailHistoryGet(dateFrom,
            dateTo, page, limit);
        - lang: Java
          source: |-
            package ClickSend;

            import ClickSend.Api.TransactionalEmailApi;

            public class view_email_history {
              public static void main(String[] args) {
                ApiClient defaultClient = new ApiClient();
                defaultClient.setUsername("USERNAME");
                defaultClient.setPassword("API_KEY");
                TransactionalEmailApi apiInstance = new TransactionalEmailApi(defaultClient);
                Integer dateFrom = 1546913229; // Integer | Start date
                Integer dateTo = 1546923229; // Integer | End date
                Integer page = 1; // Integer | Page number
                Integer limit = 10; // Integer | Number of records per page
                try {
                    String result = apiInstance.emailHistoryGet(dateFrom, dateTo, page, limit);
                    System.out.println(result);
                } catch (ApiException e) {
                    System.err.println("Exception when calling TransactionalEmailApi#emailHistoryGet");
                    e.printStackTrace();
                }
              }
            }
        - lang: Node.js
          source: >-
            var api = require('./api.js');


            var emailTransactionalApi = new
            api.TransactionalEmailApi("USERNAME", "API_KEY");


            var dateFrom = '1546913229';

            var dateTo = '1546923229';

            var page = 1;

            var limit = 10;


            emailTransactionalApi.emailHistoryGet(dateFrom, dateTo, page,
            limit).then(function(response) {
              console.log(response.body);
            }).catch(function(err){
              console.error(err.body);
            });
        - lang: Ruby
          source: |-
            # load the gem
            require 'clicksend_client'
            require 'json'

            # setup authorization
            ClickSendClient.configure do |config|
              # Configure HTTP basic authorization: BasicAuth
              config.username = 'USERNAME'
              config.password = 'API_KEY'
            end

            api_instance = ClickSendClient::TransactionalEmailApi.new

            opts = {
              date_from: 1546913229, # Integer | Start date
              date_to: 1546923229, # Integer | End date
              page: 1, # Integer | Page number
              limit: 10 # Integer | Number of records per page
            }

            begin
              # Get all transactional email history
              result = api_instance.email_history_get(opts)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling TransactionalEmailApi->email_history_get: #{e.response_body}"
            end
        - lang: Python
          source: >-
            from __future__ import print_function

            import clicksend_client

            from clicksend_client.rest import ApiException


            # Configure HTTP basic authorization: BasicAuth

            configuration = clicksend_client.Configuration()

            configuration.username = 'USERNAME'

            configuration.password = 'API_KEY'


            # create an instance of the API class

            api_instance =
            clicksend_client.TransactionalEmailApi(clicksend_client.ApiClient(configuration))

            date_from = 1546913229 # int | Start date (optional)

            date_to = 1546923229 # int | End date (optional)

            page = 1 # int | Page number (optional) (default to 1)

            limit = 10 # int | Number of records per page (optional) (default to
            10)


            try:
                # Get all transactional email history
                api_response = api_instance.email_history_get(date_from=date_from, date_to=date_to, page=page, limit=limit)
                print(api_response)
            except ApiException as e:
                print("Exception when calling TransactionalEmailApi->email_history_get: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::TransactionalEmailApi;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


            my $api = WWW::ClickSendClient::TransactionalEmailApi->new(username
            => $username, password => $password);


            my $json_output = $api->email_history_get(
                'limit' => '1',
                'page' => '1',
                'date_to' => '1546913229',
                'date_from' => '1546923229'
             );

            print $json_output;
        - lang: objc
          source: >-
            #import "CSTransactionalEmailApi.h"

            #import "CSDefaultConfiguration.h"


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

            // Configure HTTP basic authorization (authentication scheme:
            BasicAuth)

            [apiConfig setUsername:@"USERNAME"];

            [apiConfig setPassword:@"PASSWORD"];


            NSNumber *fromDate = [NSNumber numberWithInt:1436849372];

            NSNumber *toDate = [NSNumber numberWithInt:1436879372];


            CSTransactionalEmailApi *transEmailApi = [[CSTransactionalEmailApi
            alloc] init];

            [transEmailApi emailHistoryGetWithDateFrom:fromDate dateTo:toDate
            page:@(1) limit:@(15) completionHandler:^(NSString *output, NSError
            *error) {
                if (error) {
                    NSLog(@"Error: %@", error);
                } else {
                    NSLog(@"%@", output);
                }
            }];
        - lang: swift
          source: >-
            import Alamofire

            if let authHeader = Request.authorizationHeader(user: "USERNAME",
            password: "PASSWORD") {
                ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
            }


            TransactionalEmailAPI.emailHistoryGet { (dataString, error) in
                if let error = error {
                    print(error)
                } else {
                    if let data = dataString!.data(using: String.Encoding.utf8) {
                        do {
                            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                                print(dictonary)
                            } else {
                                print("bad json")
                            }
                        } catch let error as NSError {
                            print(error)
                        }
                    }
                }
            }
  /v3/email/history/export:
    get:
      summary: Export Email History
      operationId: export-email-history
      description: >-
        _Export all Transactional Email history_


        Export all Transactional Email history


        ### Parameters


        | Parameter | In | Type | Required | Description |

        | --- | --- | --- | --- | --- |

        | filename | query | string | true | Filename to download history as |

        | date_from | query | integer(int32) | false | Start date (Unix
        Timestamp e.g. 1436849372) |

        | date_to | query | integer(int32) | false | End date (Unix Timestamp
        e.g. 1436879372) |



        Refer to [Status Codes](/#status-codes) for definitions of HTTP status
        code responses.



        <div style="background-color: #FF6A4B; padding: 10px; border-radius:
        8px;">
          <span style="color: white;">This endpoint requires authentication,</span> 
          <a href="/#authentication" style="color: white; text-decoration: underline;">more info...</a>
        </div>
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/export-email-history'
      x-codeSamples:
        - lang: curl
          source: >-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
            'https://rest.clicksend.com/v3/email/history/export?filename={filename}'
        - lang: PHP
          source: >-
            <?php

            require_once(__DIR__ . '/vendor/autoload.php');


            // Configure HTTP basic authorization: BasicAuth

            $config = ClickSend\Configuration::getDefaultConfiguration()
                          ->setUsername('USERNAME')
                          ->setPassword('API_KEY');

            $apiInstance = new ClickSend\Api\TransactionalEmailApi(new
            GuzzleHttp\Client(),$config);

            $filename = "filename_example"; // string | Filename to download
            history as

            $date_from = '1436849372'; // int | Start date

            $date_to = '1436879372'; // int | End date


            try {
                $result = $apiInstance->emailHistoryExportGet($filename, $date_from, $date_to);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling TransactionalEmailApi->emailHistoryExportGet: ', $e->getMessage(), PHP_EOL;
            }

            ?>
        - lang: C#
          source: >-
            using IO.ClickSend.ClickSend.Api;

            using IO.ClickSend.Client;

            using IO.ClickSend.ClickSend.Model;


            var configuration = new Configuration()

            {
                Username = USERNAME, 
                Password = API_KEY  
            };

            var transactionalEmailApi = new
            TransactionalEmailApi(configuration);


            var filename = "filename";

            var dateFrom = '1546913229';

            var dateTo = '1546923229';


            var response = transactionalEmailApi.EmailHistoryExportGet(filename,
            dateFrom, dateTo);
        - lang: Java
          source: |-
            package ClickSend;

            import ClickSend.Api.TransactionalEmailApi;

            public class export_email_history {
              public static void main(String[] args) {
                ApiClient defaultClient = new ApiClient();
                defaultClient.setUsername("USERNAME");
                defaultClient.setPassword("API_KEY");
                TransactionalEmailApi apiInstance = new TransactionalEmailApi(defaultClient);
                String filename = "filename_example"; // String | Filename to download history as
                Integer dateFrom = 1546913229; // Integer | Start date
                Integer dateTo = 1546923229; // Integer | End date
                try {
                    String result = apiInstance.emailHistoryExportGet(filename, dateFrom, dateTo);
                    System.out.println(result);
                } catch (ApiException e) {
                    System.err.println("Exception when calling TransactionalEmailApi#emailHistoryExportGet");
                    e.printStackTrace();
                }
              }
            }
        - lang: Node.js
          source: >-
            var api = require('./api.js');


            var emailTransactionalApi = new
            api.TransactionalEmailApi("USERNAME", "API_KEY");


            var filename = "filename";

            var dateFrom = '1546913229';

            var dateTo = '1546923229';


            emailTransactionalApi.emailHistoryExportGet(filename, dateFrom,
            dateTo).then(function(response) {
              console.log(response.body);
            }).catch(function(err){
              console.error(err.body);
            });
        - lang: Ruby
          source: >-
            # load the gem

            require 'clicksend_client'

            require 'json'


            # setup authorization

            ClickSendClient.configure do |config|
              # Configure HTTP basic authorization: BasicAuth
              config.username = 'USERNAME'
              config.password = 'API_KEY'
            end


            api_instance = ClickSendClient::TransactionalEmailApi.new


            filename = "filename_example" # String | Filename to download
            history as


            opts = {
              date_from: 1546913229, # Integer | Start date
              date_to: 1546923229 # Integer | End date
            }


            begin
              # Export all Transactional Email history
              result = api_instance.email_history_export_get(filename, opts)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling TransactionalEmailApi->email_history_export_get: #{e.response_body}"
            end
        - lang: Python
          source: >-
            from __future__ import print_function

            import clicksend_client

            from clicksend_client.rest import ApiException


            # Configure HTTP basic authorization: BasicAuth

            configuration = clicksend_client.Configuration()

            configuration.username = 'USERNAME'

            configuration.password = 'API_KEY'


            # create an instance of the API class

            api_instance =
            clicksend_client.TransactionalEmailApi(clicksend_client.ApiClient(configuration))

            filename = 'filename_example' # str | Filename to download history
            as

            date_from = 1546913229 # int | Start date (optional)

            date_to = 1546923229 # int | End date (optional)


            try:
                # Export all Transactional Email history
                api_response = api_instance.email_history_export_get(filename, date_from=date_from, date_to=date_to)
                print(api_response)
            except ApiException as e:
                print("Exception when calling TransactionalEmailApi->email_history_export_get: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::TransactionalEmailApi;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


            my $api = WWW::ClickSendClient::TransactionalEmailApi->new(username
            => $username, password => $password);


            my $json_output = $api->email_history_export_get('filename' =>
            'filename','date_to' => '1546913229','date_from' => '1546923229');


            print $json_output;
        - lang: objc
          source: >-
            #import "CSTransactionalEmailApi.h"

            #import "CSDefaultConfiguration.h"


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

            // Configure HTTP basic authorization (authentication scheme:
            BasicAuth)

            [apiConfig setUsername:@"USERNAME"];

            [apiConfig setPassword:@"PASSWORD"];


            NSNumber *fromDate = [NSNumber numberWithInt:1436849372];

            NSNumber *toDate = [NSNumber numberWithInt:1436879372];


            CSTransactionalEmailApi *transEmailApi = [[CSTransactionalEmailApi
            alloc] init];

            [transEmailApi emailHistoryExportGetWithFilename:@"filename"
            dateFrom:fromDate dateTo:toDate completionHandler:^(NSString
            *output, NSError *error) {
                if (error) {
                    NSLog(@"Error: %@", error);
                } else {
                    NSLog(@"%@", output);
                }
            }];
        - lang: swift
          source: >-
            import Alamofire

            if let authHeader = Request.authorizationHeader(user: "USERNAME",
            password: "PASSWORD") {
                ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
            }


            TransactionalEmailAPI.emailHistoryExportGet(filename: "filename") {
            (dataString, error) in
                if let error = error {
                    print(error)
                } else {
                    if let data = dataString!.data(using: String.Encoding.utf8) {
                        do {
                            if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                                print(dictonary)
                            } else {
                                print("bad json")
                            }
                        } catch let error as NSError {
                            print(error)
                        }
                    }
                }
            }
  /v3/email/addresses:
    get:
      summary: View Allowed Email Addresses
      operationId: view-allowed-email-addresses
      description: >-
        _Get all email addresses_


        Get all email addresses


        ### Parameters


        | Parameter | In | Type | Required | Description |

        | --- | --- | --- | --- | --- |

        | page | query | integer(int32) | false | Page number |

        | limit | query | integer(int32) | false | Number of records per page |



        Refer to [Status Codes](/#status-codes) for definitions of HTTP status
        code responses.



        <div style="background-color: #FF6A4B; padding: 10px; border-radius:
        8px;">
          <span style="color: white;">This endpoint requires authentication,</span> 
          <a href="/#authentication" style="color: white; text-decoration: underline;">more info...</a>
        </div>
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/view-allowed-email-addresses'
      x-codeSamples:
        - lang: curl
          source: |-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
            'https://rest.clicksend.com/v3/email/addresses'
        - lang: PHP
          source: >-
            <?php

            require_once(__DIR__ . '/vendor/autoload.php');


            // Configure HTTP basic authorization: BasicAuth

            $config = ClickSend\Configuration::getDefaultConfiguration()
                          ->setUsername('USERNAME')
                          ->setPassword('API_KEY');

            $apiInstance = new ClickSend\Api\EmailMarketingApi(new
            GuzzleHttp\Client(),$config);

            $page = 1; // int | Page number

            $limit = 10; // int | Number of records per page


            try {
                $result = $apiInstance->allowedEmailAddressGet($page, $limit);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling EmailMarketingApi->allowedEmailAddressGet: ', $e->getMessage(), PHP_EOL;
            }

            ?>
        - lang: C#
          source: |-
            using IO.ClickSend.ClickSend.Api;
            using IO.ClickSend.Client;
            using IO.ClickSend.ClickSend.Model;

            var configuration = new Configuration()
            {
                Username = USERNAME, 
                Password = API_KEY  
            };
            var emailMarketingApi = new EmailMarketingApi(configuration);
            var response = emailMarketingApi.AllowedEmailAddressGet();
        - lang: Java
          source: |-
            package ClickSend;

            import ClickSend.Api.EmailMarketingApi;

            public class view_all_allowed_email_address {
              public static void main(String[] args) {
                ApiClient defaultClient = new ApiClient();
                defaultClient.setUsername("USERNAME");
                defaultClient.setPassword("API_KEY");
                EmailMarketingApi apiInstance = new EmailMarketingApi(defaultClient);
                Integer page = 1; // Integer | Page number
                Integer limit = 10; // Integer | Number of records per page
                try {
                    String result = apiInstance.allowedEmailAddressGet(page, limit);
                    System.out.println(result);
                } catch (ApiException e) {
                    System.err.println("Exception when calling EmailMarketingApi#allowedEmailAddressGet");
                    e.printStackTrace();
                }
              }
            }
        - lang: Node.js
          source: >-
            var api = require('./api.js');


            var emailMarketingApi = new api.EmailMarketingApi("USERNAME",
            "API_KEY");


            var page = 1;

            var limit = 10;


            emailMarketingApi.allowedEmailAddressGet(page,
            limit).then(function(response) {
              console.log(response.body);
            }).catch(function(err){
              console.error(err.body);
            });
        - lang: Ruby
          source: |-
            # load the gem
            require 'clicksend_client'
            require 'json'

            # setup authorization
            ClickSendClient.configure do |config|
              # Configure HTTP basic authorization: BasicAuth
              config.username = 'USERNAME'
              config.password = 'API_KEY'
            end

            api_instance = ClickSendClient::EmailMarketingApi.new

            opts = {
              page: 1,  # Integer | Page number
              limit: 10 # Integer | Number of records per page
            }

            begin
              # Get all email addresses
              result = api_instance.allowed_email_address_get(opts)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling EmailMarketingApi->allowed_email_address_get: #{e.response_body}"
            end
        - lang: Python
          source: >-
            from __future__ import print_function

            import clicksend_client

            from clicksend_client.rest import ApiException


            # Configure HTTP basic authorization: BasicAuth

            configuration = clicksend_client.Configuration()

            configuration.username = 'USERNAME'

            configuration.password = 'API_KEY'


            # create an instance of the API class

            api_instance =
            clicksend_client.EmailMarketingApi(clicksend_client.ApiClient(configuration))

            page = 1 # int | Page number (optional) (default to 1)

            limit = 10 # int | Number of records per page (optional) (default to
            10)


            try:
                # Get all email addresses
                api_response = api_instance.allowed_email_address_get(page=page, limit=limit)
                print(api_response)
            except ApiException as e:
                print("Exception when calling EmailMarketingApi->allowed_email_address_get: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::EmailMarketingApi;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


            my $api = WWW::ClickSendClient::EmailMarketingApi->new(username =>
            $username, password => $password);


            my $json_output = $api->allowed_email_address_get('page' => '1'
            ,'limit'  => '');


            print $json_output;
        - lang: objc
          source: >-
            #import "CSEmailMarketingApi.h"



            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

            [apiConfig setUsername:@"USERNAME"];

            [apiConfig setPassword:@"PASSWORD"];


            NSNumber *page = [[NSNumber alloc] initWithInt:1];

            NSNumber *limit = [[NSNumber alloc] initWithInt:1];


            CSEmailMarketingApi *emailMarketingApiInstance =
            [[CSEmailMarketingApi alloc] init];

            [emailMarketingApiInstance allowedEmailAddressGetWithPage:page
            limit:limit completionHandler:^(NSString *output, NSError *error) {
                if (error) {
                    NSLog(@"Error: %@", error);
                } else {
                    NSLog(@"%@", output);
                }
            }];
        - lang: swift
          source: >-
            import Alamofire


            if let authHeader = Request.authorizationHeader(user: "USERNAME",
            password: "PASSWORD") {
                ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
            }

            EmailMarketingAPI.allowedEmailAddressGet { (dataString, error) in
                guard let dataString = dataString else {
                    print(error!)
                    return
                }

                if let data = dataString.data(using: String.Encoding.utf8) {
                    do {
                        if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                            print(dictonary)
                        } else {
                            print("Cannot convert the String value to JSON")
                        }
                    } catch let error as NSError {
                        print(error)
                    }
                }
            }
    post:
      summary: Create Allowed Email Address
      operationId: create-allowed-email-address
      description: >-
        _Create allowed Email Address_


        Create allowed Email Address


        ### Parameters


        | Parameter | In | Type | Required | Description |

        | --- | --- | --- | --- | --- |

        | body | body | string | true | Email to be allowed. |


        Refer to [Status Codes](/#status-codes) for definitions of HTTP status
        code responses.


        <div style="background-color: #FF6A4B; padding: 10px; border-radius:
        8px;">
          <span style="color: white;">This endpoint requires authentication,</span> 
          <a href="/#authentication" style="color: white; text-decoration: underline;">more info...</a>
        </div>
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                email_address:
                  type: string
              example:
                email_address: test@test.com
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/create-allowed-email-address'
      x-codeSamples:
        - lang: curl
          source: |-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
                 --request POST \
                 --header "Content-Type: application/json" \
                 --data-binary "{
              \"email_address\": \"johndoe1@user.com\",
              \"Body\": \"\"
            }" \
            'https://rest.clicksend.com/v3/email/addresses'
        - lang: PHP
          source: >-
            <?php

            require_once(__DIR__ . '/vendor/autoload.php');


            // Configure HTTP basic authorization: BasicAuth

            $config = ClickSend\Configuration::getDefaultConfiguration()
                          ->setUsername('USERNAME')
                          ->setPassword('API_KEY');

            $apiInstance = new ClickSend\Api\EmailMarketingApi(new
            GuzzleHttp\Client(),$config);

            $email_address = new \ClickSend\Model\EmailAddress(); //
            \ClickSend\Model\EmailAddress |

            $email_address->setEmailAddress("xxx@gmail.com"); 


            try {
                $result = $apiInstance->allowedEmailAddressPost($email_address);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling EmailMarketingApi->allowedEmailAddressPost: ', $e->getMessage(), PHP_EOL;
            }

            ?>
        - lang: C#
          source: >-
            using IO.ClickSend.ClickSend.Api;

            using IO.ClickSend.Client;

            using IO.ClickSend.ClickSend.Model;


            var configuration = new Configuration()

            {
                Username = USERNAME, 
                Password = API_KEY  
            };

            var deliveryIssuesApi = new DeliveryIssuesApi(configuration);

            var response = emailMarketingApi.AllowedEmailAddressPost(new
            EmailAddress(
                emailAddress: "john@doe.com"
            ));
        - lang: Java
          source: |
            package ClickSend;

            import ClickSend.Api.EmailMarketingApi;
            import ClickSend.Model.EmailAddress;

            public class create_allowed_email_address {
              public static void main(String[] args) {
                ApiClient defaultClient = new ApiClient();
                defaultClient.setUsername("USERNAME");
                defaultClient.setPassword("API_KEY");
                EmailMarketingApi apiInstance = new EmailMarketingApi(defaultClient);
                EmailAddress emailAddress = new EmailAddress(); // EmailAddress | 
                emailAddress.emailAddress("xxx@gmail.com");
                try {
                    String result = apiInstance.allowedEmailAddressPost(emailAddress);
                    System.out.println(result);
                } catch (ApiException e) {
                    System.err.println("Exception when calling EmailMarketingApi#allowedEmailAddressPost");
                    e.printStackTrace();
                }
              }
            }
        - lang: Node.js
          source: >-
            var api = require('./api.js');


            var emailMarketingApi = new api.EmailMarketingApi("USERNAME",
            "API_KEY");


            var emailAddress = new api.EmailAddress();


            emailAddress.emailAddress = "xxx@gmail.com";


            emailMarketingApi.allowedEmailAddressPost(emailAddress).then(function(response)
            {
              console.log(response.body);
            }).catch(function(err){
              console.error(err.body);
            });
        - lang: Ruby
          source: |-
            # load the gem
            require 'clicksend_client'
            require 'json'

            # setup authorization
            ClickSendClient.configure do |config|
              # Configure HTTP basic authorization: BasicAuth
              config.username = 'USERNAME'
              config.password = 'API_KEY'
            end

            api_instance = ClickSendClient::EmailMarketingApi.new

            # EmailAddress |
            opts = {
              email_address: ClickSendClient::EmailAddress.new(
                "email_address": "test@test.com"
              )
            }

            begin
              # Create allowed Email Address
              result = api_instance.allowed_email_address_post(opts)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling EmailMarketingApi->allowed_email_address_post: #{e.response_body}"
            end
        - lang: Python
          source: >-
            from __future__ import print_function

            import clicksend_client

            from clicksend_client.rest import ApiException


            # Configure HTTP basic authorization: BasicAuth

            configuration = clicksend_client.Configuration()

            configuration.username = 'USERNAME'

            configuration.password = 'API_KEY'


            # create an instance of the API class

            api_instance =
            clicksend_client.EmailMarketingApi(clicksend_client.ApiClient(configuration))

            # EmailAddress |  (optional)

            email_address =
            clicksend_client.EmailAddress(email_address='abc@gmail.com') 


            try:
                # Create allowed Email Address
                api_response = api_instance.allowed_email_address_post(email_address=email_address)
                print(api_response)
            except ApiException as e:
                print("Exception when calling EmailMarketingApi->allowed_email_address_post: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::EmailMarketingApi;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


            my $api = WWW::ClickSendClient::EmailMarketingApi->new(username =>
            $username, password => $password);


            my $json_output = $api->allowed_email_address_post('email_address'
            => 'test2@test.com');


            print $json_output;
        - lang: objc
          source: "CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration sharedConfig];\n[apiConfig setUsername:@\"USERNAME\"];\n[apiConfig setPassword:@\"PASSWORD\"];\n\nCSEmailMarketingApi *emailMarketingApiInstance = [[CSEmailMarketingApi alloc] init];\n\nCSEmailAddress *emailAddress = [[CSEmailAddress alloc] init];\nemailAddress.emailAddress = @\"\x10johndoe1@gmail.com\";\n\n[emailMarketingApiInstance allowedEmailAddressPostWithEmailAddress:emailAddress completionHandler:^(NSString *output, NSError *error) {\n    if (error) {\n        NSLog(@\"Error: %@\", error);\n    } else {\n        NSLog(@\"%@\", output);\n    }\n}];"
        - lang: swift
          source: >-
            import Alamofire


            if let authHeader = Request.authorizationHeader(user: "USERNAME",
            password: "PASSWORD") {
                ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
            }


            EmailMarketingAPI.allowedEmailAddressPost { (dataString, error) in
                guard let dataString = dataString else {
                    print(error!)
                    return
                }
                if let data = dataString.data(using: String.Encoding.utf8) {
                    do {
                        if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                            print(dictonary)
                        } else {
                            print("Cannot convert the String value to JSON")
                        }
                    } catch let error as NSError {
                        print(error)
                    }
                }
            }
  /v3/email/address-verify/{email_address_id}/send:
    put:
      summary: Send Email Verification Token
      operationId: send-email-verification-token
      description: >-
        _Send verification token_


        Send verification token


        ### Parameters


        | Parameter | In | Type | Required | Description |

        | --- | --- | --- | --- | --- |

        | email_address_id | path | integer(int32) | true | Allowed email
        address id |



        Refer to [Status Codes](/#status-codes) for definitions of HTTP status
        code responses.



        <div style="background-color: #FF6A4B; padding: 10px; border-radius:
        8px;">
          <span style="color: white;">This endpoint requires authentication,</span> 
          <a href="/#authentication" style="color: white; text-decoration: underline;">more info...</a>
        </div>
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                to:
                  type: array
                  items:
                    type: object
                    properties:
                      email:
                        type: string
                        format: email
                      name:
                        type: string
                from:
                  type: object
                  properties:
                    email_address_id:
                      type: integer
                    name:
                      type: string
                subject:
                  type: string
                body:
                  type: string
              example:
                to:
                  - email: test@test.com
                    name: Test From
                from:
                  email_address_id: 2
                  name: Test
                subject: Test Subject
                body: Test Body
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
        - name: email_address_id
          in: path
          schema:
            type: string
          required: true
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/send-email-verification-token'
      x-codeSamples:
        - lang: curl
          source: >-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
                 --request PUT \
            'https://rest.clicksend.com/v3/email/address-verify/{email_address_id}/send'
        - lang: PHP
          source: >-
            <?php

            require_once(__DIR__ . '/vendor/autoload.php');


            // Configure HTTP basic authorization: BasicAuth

            $config = ClickSend\Configuration::getDefaultConfiguration()
                          ->setUsername('USERNAME')
                          ->setPassword('API_KEY');

            $apiInstance = new ClickSend\Api\EmailMarketingApi(new
            GuzzleHttp\Client(),$config);

            $email_address_id = 4366; // int | Allowed email address id


            try {
                $result = $apiInstance->sendVerificationTokenGet($email_address_id);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling EmailMarketingApi->sendVerificationTokenGet: ', $e->getMessage(), PHP_EOL;
            }

            ?>
        - lang: C#
          source: >-
            using IO.ClickSend.ClickSend.Api;

            using IO.ClickSend.Client;

            using IO.ClickSend.ClickSend.Model;


            var configuration = new Configuration()

            {
                Username = USERNAME, 
                Password = API_KEY  
            };

            var emailMarketingApi = new EmailMarketingApi(configuration);

            var response =
            emailMarketingApi.SendVerificationTokenGet(EMAIL_ADDRESS_ID);
        - lang: Java
          source: |
            package ClickSend;

            import ClickSend.Api.EmailMarketingApi;

            public class send_email_verification_token {
              public static void main(String[] args) {
                ApiClient defaultClient = new ApiClient();
                defaultClient.setUsername("USERNAME");
                defaultClient.setPassword("API_KEY");
                EmailMarketingApi apiInstance = new EmailMarketingApi(defaultClient);
                Integer emailAddressId = 4244; // Integer | Allowed email address id
                try {
                    String result = apiInstance.sendVerificationTokenGet(emailAddressId);
                    System.out.println(result);
                } catch (ApiException e) {
                    System.err.println("Exception when calling EmailMarketingApi#sendVerificationTokenGet");
                    e.printStackTrace();
                }
              }
            }
        - lang: Node.js
          source: >-
            var api = require('./api.js');


            var emailMarketingApi = new api.EmailMarketingApi("USERNAME",
            "API_KEY");


            var emailAddressId = 4399;


            emailMarketingApi.sendVerificationTokenGet(emailAddressId).then(function(response)
            {
              console.log(response.body);
            }).catch(function(err){
              console.error(err.body);
            });
        - lang: Ruby
          source: |-
            # load the gem
            require 'clicksend_client'
            require 'json'

            # setup authorization
            ClickSendClient.configure do |config|
              # Configure HTTP basic authorization: BasicAuth
              config.username = 'USERNAME'
              config.password = 'API_KEY'
            end

            api_instance = ClickSendClient::EmailMarketingApi.new

            email_address_id = 56 # Integer | Allowed email address id

            begin
              # Send verification token
              result = api_instance.send_verification_token_get(email_address_id)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling EmailMarketingApi->send_verification_token_get: #{e.response_body}"
            end
        - lang: Python
          source: >-
            from __future__ import print_function

            import clicksend_client

            from clicksend_client.rest import ApiException


            # Configure HTTP basic authorization: BasicAuth

            configuration = clicksend_client.Configuration()

            configuration.username = 'USERNAME'

            configuration.password = 'API_KEY'


            # create an instance of the API class

            api_instance =
            clicksend_client.EmailMarketingApi(clicksend_client.ApiClient(configuration))

            email_address_id = 56 # int | Allowed email address id


            try:
                # Send verification token
                api_response = api_instance.send_verification_token_get(email_address_id)
                print(api_response)
            except ApiException as e:
                print("Exception when calling EmailMarketingApi->send_verification_token_get: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::EmailMarketingApi;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


            my $api = WWW::ClickSendClient::EmailMarketingApi->new(username =>
            $username, password => $password);


            my $json_output =
            $api->send_verification_token_put('email_address_id' => '12345');


            print $json_output;
        - lang: objc
          source: >-
            #import "CSEmailMarketingApi.h"



            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

            [apiConfig setUsername:@"USERNAME"];

            [apiConfig setPassword:@"PASSWORD"];


            NSNumber *emailId = [[NSNumber alloc] initWithInt:1];


            CSEmailMarketingApi *emailMarketingApiInstance =
            [[CSEmailMarketingApi alloc] init];

            [emailMarketingApiInstance
            sendVerificationTokenGetWithEmailAddressId:emailId
            completionHandler:^(NSString *output, NSError *error) {
                if (error) {
                    NSLog(@"Error: %@", error);
                } else {
                    NSLog(@"%@", output);
                }
            }];
        - lang: swift
          source: >-
            import Alamofire


            if let authHeader = Request.authorizationHeader(user: "USERNAME",
            password: "PASSWORD") {
                ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
            }


            EmailMarketingAPI.sendVerificationTokenGet(emailAddressId: 1) {
            (dataString, error) in
                guard let dataString = dataString else {
                    print(error!)
                    return
                }

                if let data = dataString.data(using: String.Encoding.utf8) {
                    do {
                        if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                            print(dictonary)
                        } else {
                            print("Cannot convert the String value to JSON")
                        }
                    } catch let error as NSError {
                        print(error)
                    }
                }
            }
  /v3/email/address-verify/{email_address_id}/verify/{activation_token}:
    put:
      summary: Verify Allowed Email Address
      operationId: verify-allowed-email-address
      description: >-
        _Verify email address using verification token_


        Verify email address using verification token


        ### Parameters


        | Parameter | In | Type | Required | Description |

        | --- | --- | --- | --- | --- |

        | email_address_id | path | integer(int32) | true | Allowed email
        address id |

        | activation_token | path | string | true | Your activation token. |


        Refer to [Status Codes](/#status-codes) for definitions of HTTP status
        code responses.


        <div style="background-color: #FF6A4B; padding: 10px; border-radius:
        8px;">
          <span style="color: white;">This endpoint requires authentication,</span> 
          <a href="/#authentication" style="color: white; text-decoration: underline;">more info...</a>
        </div>
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                to:
                  type: array
                  items:
                    type: object
                    properties:
                      email:
                        type: string
                      name:
                        type: string
                from:
                  type: object
                  properties:
                    email_address_id:
                      type: integer
                    name:
                      type: string
                subject:
                  type: string
                body:
                  type: string
              example:
                to:
                  - email: test@test.com
                    name: test from
                from:
                  email_address_id: 2
                  name: test
                subject: test subject
                body: test body
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
        - name: email_address_id
          in: path
          schema:
            type: string
          required: true
        - name: activation_token
          in: path
          schema:
            type: string
          required: true
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/verify-allowed-email-address'
      x-codeSamples:
        - lang: curl
          source: >-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
                 --request PUT \
            'https://rest.clicksend.com/v3/email/address-verify/{email_address_id}/verify/{activation_token}'
        - lang: PHP
          source: >-
            <?php

            require_once(__DIR__ . '/vendor/autoload.php');


            // Configure HTTP basic authorization: BasicAuth

            $config = ClickSend\Configuration::getDefaultConfiguration()
                          ->setUsername('USERNAME')
                          ->setPassword('API_KEY');

            $apiInstance = new ClickSend\Api\EmailMarketingApi(new
            GuzzleHttp\Client(),$config);

            $email_address_id = 4366; // int | Allowed email address id

            $activation_token = "C3395F04-F2CA-4BD5-A2B5-5A96D598A7F0"; //
            string | Your activation token.


            try {
                $result = $apiInstance->verifyAllowedEmailAddressGet($email_address_id, $activation_token);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling EmailMarketingApi->verifyAllowedEmailAddressGet: ', $e->getMessage(), PHP_EOL;
            }

            ?>
        - lang: C#
          source: >-
            using IO.ClickSend.ClickSend.Api;

            using IO.ClickSend.Client;

            using IO.ClickSend.ClickSend.Model;


            var configuration = new Configuration()

            {
                Username = USERNAME, 
                Password = API_KEY  
            };

            var emailMarketingApi = new EmailMarketingApi(configuration);

            var response =
            emailMarketingApi.VerifyAllowedEmailAddressGet(EMAIL_ADDRESS_ID,
            "ACTIVATION_CODE");
        - lang: Java
          source: |
            package ClickSend;

            import ClickSend.Api.EmailMarketingApi;

            public class verify_allowed_email_address {
              public static void main(String[] args) {
                ApiClient defaultClient = new ApiClient();
                defaultClient.setUsername("USERNAME");
                defaultClient.setPassword("API_KEY");
                EmailMarketingApi apiInstance = new EmailMarketingApi(defaultClient);
                Integer emailAddressId = 4245; // Integer | Allowed email address id
                // String | Your activation token.
                String activationToken = "activation_token_example"; 
                try {
                    String result = apiInstance.verifyAllowedEmailAddressGet(emailAddressId, activationToken);
                    System.out.println(result);
                } catch (ApiException e) {
                    System.err.println("Exception when calling EmailMarketingApi#verifyAllowedEmailAddressGet");
                    e.printStackTrace();
                }
              }
            }
        - lang: Node.js
          source: >-
            var api = require('./api.js');


            var emailMarketingApi = new api.EmailMarketingApi("USERNAME",
            "API_KEY");


            var emailAddressId = 4400;

            var activationToken = "B7A249DE-81EB-47FA-B320-B2F1D9EDAEFA";


            emailMarketingApi.verifyAllowedEmailAddressGet(emailAddressId,
            activationToken).then(function(response) {
              console.log(response.body);
            }).catch(function(err){
              console.error(err.body);
            });
        - lang: Ruby
          source: >-
            # load the gem

            require 'clicksend_client'

            require 'json'


            # setup authorization

            ClickSendClient.configure do |config|
              # Configure HTTP basic authorization: BasicAuth
              config.username = 'USERNAME'
              config.password = 'API_KEY'
            end


            api_instance = ClickSendClient::EmailMarketingApi.new


            email_address_id = 56 # Integer | Allowed email address id


            activation_token = "activation_token" # String | Your activation
            token.


            begin
              # Verify email address using verification token
              result = api_instance.verify_allowed_email_address_get(email_address_id, activation_token)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling EmailMarketingApi->verify_allowed_email_address_get: #{e.response_body}"
            end
        - lang: Python
          source: >-
            from __future__ import print_function

            import clicksend_client

            from clicksend_client.rest import ApiException


            # Configure HTTP basic authorization: BasicAuth

            configuration = clicksend_client.Configuration()

            configuration.username = 'USERNAME'

            configuration.password = 'API_KEY'


            # create an instance of the API class

            api_instance =
            clicksend_client.EmailMarketingApi(clicksend_client.ApiClient(configuration))

            email_address_id = 56 # int | Allowed email address id

            activation_token = 'activation_token_example' # str | Your
            activation token.


            try:
                # Verify email address using verification token
                api_response = api_instance.verify_allowed_email_address_get(email_address_id, activation_token)
                print(api_response)
            except ApiException as e:
                print("Exception when calling EmailMarketingApi->verify_allowed_email_address_get: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::EmailMarketingApi;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


            my $api = WWW::ClickSendClient::EmailMarketingApi->new(username =>
            $username, password => $password);


            my $json_output =
            $api->verify_allowed_email_address_put('email_address_id' => '12345'
            , 'activation_token' => 'XXXXXXXX-XXXXX-XXXXXX-XXXX-XXXXXXXX');


            print $json_output;
        - lang: objc
          source: >-
            #import "CSEmailMarketingApi.h"


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

            [apiConfig setUsername:@"USERNAME"];

            [apiConfig setPassword:@"PASSWORD"];



            CSEmailMarketingApi *emailMarketingApiInstance =
            [[CSEmailMarketingApi alloc] init];

            NSNumber *emailAddressId = [[NSNumber alloc] initWithInt:1];


            [emailMarketingApiInstance
            verifyAllowedEmailAddressGetWithEmailAddressId:emailAddressId
            activationToken:@"activation_token" completionHandler:^(NSString
            *output, NSError *error) {
                if (error) {
                    NSLog(@"Error: %@", error);
                } else {
                    NSLog(@"%@", output);
                }
            }];
        - lang: swift
          source: >-
            import Alamofire


            if let authHeader = Request.authorizationHeader(user: "USERNAME",
            password: "PASSWORD") {

            ClickSendClientAPI.customHeaders = [authHeader.key :
            authHeader.value]


            EmailMarketingAPI.verifyAllowedEmailAddressGet(emailAddressId: 1,
            activationToken: "activation_token") { (dataString, error) in
                guard let dataString = dataString else {
                    print(error!)
                    return
                }

                if let data = dataString.data(using: String.Encoding.utf8) {
                    do {
                        if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                            print(dictonary)
                        } else {
                            print("Cannot convert the String value to JSON")
                        }
                    } catch let error as NSError {
                        print(error)
                    }
                }
            }
  /v3/email/addresses/{email_address_id}:
    get:
      summary: View Allowed Email Address
      operationId: view-allowed-email-address
      description: >-
        _Get specific email address_


        Get specific email address


        ### Parameters


        | Parameter | In | Type | Required | Description |

        | --- | --- | --- | --- | --- |

        | email_address_id | path | integer(int32) | true | Allowed email
        address id |


        Refer to [Status Codes](/#status-codes) for definitions of HTTP status
        code responses.


        <div style="background-color: #FF6A4B; padding: 10px; border-radius:
        8px;">
          <span style="color: white;">This endpoint requires authentication,</span> 
          <a href="/#authentication" style="color: white; text-decoration: underline;">more info...</a>
        </div>
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
        - name: email_address_id
          in: path
          schema:
            type: string
          required: true
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/view-allowed-email-address'
      x-codeSamples:
        - lang: curl
          source: |-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
            'https://rest.clicksend.com/v3/email/addresses/{email_address_id}'
        - lang: PHP
          source: >-
            <?php

            require_once(__DIR__ . '/vendor/autoload.php');


            // Configure HTTP basic authorization: BasicAuth

            $config = ClickSend\Configuration::getDefaultConfiguration()
                          ->setUsername('USERNAME')
                          ->setPassword('API_KEY');

            $apiInstance = new ClickSend\Api\EmailMarketingApi(new
            GuzzleHttp\Client(),$config);

            $email_address_id = 4366; // int | Allowed email address id


            try {
                $result = $apiInstance->specificAllowedEmailAddressGet($email_address_id);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling EmailMarketingApi->specificAllowedEmailAddressGet: ', $e->getMessage(), PHP_EOL;
            }

            ?>
        - lang: C#
          source: >-
            using IO.ClickSend.ClickSend.Api;

            using IO.ClickSend.Client;

            using IO.ClickSend.ClickSend.Model;


            var configuration = new Configuration()

            {
                Username = USERNAME, 
                Password = API_KEY  
            };

            var emailMarketingApi = new EmailMarketingApi(configuration);

            var response =
            emailMarketingApi.SpecificAllowedEmailAddressGet(EMAIL_ADDRESS_ID);
        - lang: Java
          source: |-
            package ClickSend;

            import ClickSend.Api.EmailMarketingApi;

            public class view_specific_allowed_email_address {
              public static void main(String[] args) {
                ApiClient defaultClient = new ApiClient();
                defaultClient.setUsername("USERNAME");
                defaultClient.setPassword("API_KEY");
                EmailMarketingApi apiInstance = new EmailMarketingApi(defaultClient);
                Integer emailAddressId = 4245; // Integer | Allowed email address id
                try {
                    String result = apiInstance.specificAllowedEmailAddressGet(emailAddressId);
                    System.out.println(result);
                } catch (ApiException e) {
                    System.err.println("Exception when calling EmailMarketingApi#specificAllowedEmailAddressGet");
                    e.printStackTrace();
                }
              }
            }
        - lang: Node.js
          source: >-
            var api = require('./api.js');


            var emailMarketingApi = new api.EmailMarketingApi("USERNAME",
            "API_KEY");


            var emailAddressId = 4400;


            emailMarketingApi.specificAllowedEmailAddressGet(emailAddressId).then(function(response)
            {
              console.log(response.body);
            }).catch(function(err){
              console.error(err.body);
            });
        - lang: Ruby
          source: |-
            # load the gem
            require 'clicksend_client'
            require 'json'

            # setup authorization
            ClickSendClient.configure do |config|
              # Configure HTTP basic authorization: BasicAuth
              config.username = 'USERNAME'
              config.password = 'API_KEY'
            end

            api_instance = ClickSendClient::EmailMarketingApi.new

            email_address_id = 56 # Integer | Allowed email address id

            begin
              # Get specific email address
              result = api_instance.specific_allowed_email_address_get(email_address_id)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling EmailMarketingApi->specific_allowed_email_address_get: #{e.response_body}"
            end
        - lang: Python
          source: >-
            from __future__ import print_function

            import clicksend_client

            from clicksend_client.rest import ApiException


            # Configure HTTP basic authorization: BasicAuth

            configuration = clicksend_client.Configuration()

            configuration.username = 'USERNAME'

            configuration.password = 'API_KEY'


            # create an instance of the API class

            api_instance =
            clicksend_client.EmailMarketingApi(clicksend_client.ApiClient(configuration))

            email_address_id = 56 # int | Allowed email address id


            try:
                # Get specific email address
                api_response = api_instance.specific_allowed_email_address_get(email_address_id)
                print(api_response)
            except ApiException as e:
                print("Exception when calling EmailMarketingApi->specific_allowed_email_address_get: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::EmailMarketingApi;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


            my $api = WWW::ClickSendClient::EmailMarketingApi->new(username =>
            $username, password => $password);


            my $json_output =
            $api->specific_allowed_email_address_get('email_address_id' =>
            '12345' );


            print $json_output;
        - lang: objc
          source: >-
            #import "CSEmailMarketingApi.h"


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

            [apiConfig setUsername:@"USERNAME"];

            [apiConfig setPassword:@"PASSWORD"];


            NSNumber *emailId = [[NSNumber alloc] initWithInt:1];

            CSEmailMarketingApi *emailMarketingApiInstance =
            [[CSEmailMarketingApi alloc] init];

            [emailMarketingApiInstance
            specificAllowedEmailAddressGetWithEmailAddressId:emailId
            completionHandler:^(NSString *output, NSError *error) {
                if (error) {
                    NSLog(@"Error: %@", error);
                } else {
                    NSLog(@"%@", output);
                }
            }];
        - lang: swift
          source: >-
            import Alamofire


            if let authHeader = Request.authorizationHeader(user: "USERNAME",
            password: "PASSWORD") {
                ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
            }


            EmailMarketingAPI.specificAllowedEmailAddressGet(emailAddressId: 1)
            { (dataString, error) in
                guard let dataString = dataString else {
                    print(error!)
                    return
                }

                if let data = dataString.data(using: String.Encoding.utf8) {
                    do {
                        if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                            print(dictonary)
                        } else {
                            print("Cannot convert the String value to JSON")
                        }
                    } catch let error as NSError {
                        print(error)
                    }
                }
            }
    delete:
      summary: Delete Allowed Email Address
      operationId: delete-allowed-email-address
      description: >-
        _Delete specific email address_


        Delete specific email address


        ### Parameters


        | Parameter | In | Type | Required | Description |

        | --- | --- | --- | --- | --- |

        | email_address_id | path | integer(int32) | true | Allowed email
        address id |



        Refer to [Status Codes](/#status-codes) for definitions of HTTP status
        code responses.



        <div style="background-color: #FF6A4B; padding: 10px; border-radius:
        8px;">
          <span style="color: white;">This endpoint requires authentication,</span> 
          <a href="/#authentication" style="color: white; text-decoration: underline;">more info...</a>
        </div>
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
        - name: email_address_id
          in: path
          schema:
            type: string
          required: true
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/delete-allowed-email-address'
      x-codeSamples:
        - lang: curl
          source: |-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
                 --request DELETE \
            'https://rest.clicksend.com/v3/email/addresses/{email_address_id}'
        - lang: PHP
          source: >-
            <?php

            require_once(__DIR__ . '/vendor/autoload.php');


            // Configure HTTP basic authorization: BasicAuth

            $config = ClickSend\Configuration::getDefaultConfiguration()
                          ->setUsername('USERNAME')
                          ->setPassword('API_KEY');

            $apiInstance = new ClickSend\Api\EmailMarketingApi(new
            GuzzleHttp\Client(),$config);

            $email_address_id = 4245; // int | Allowed email address id


            try {
                $result = $apiInstance->specificAllowedEmailAddressDelete($email_address_id);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling EmailMarketingApi->specificAllowedEmailAddressDelete: ', $e->getMessage(), PHP_EOL;
            }

            ?>
        - lang: C#
          source: >-
            using IO.ClickSend.ClickSend.Api;

            using IO.ClickSend.Client;

            using IO.ClickSend.ClickSend.Model;


            var configuration = new Configuration()

            {
                Username = USERNAME, 
                Password = API_KEY  
            };

            var emailMarketingApi = new EmailMarketingApi(configuration);

            var response =
            emailMarketingApi.SpecificAllowedEmailAddressDelete(EMAIL_ADDRESS_ID);
        - lang: Java
          source: |-
            package ClickSend;

            import ClickSend.Api.EmailMarketingApi;

            public class delete_allowed_email_address {
              public static void main(String[] args) {
                ApiClient defaultClient = new ApiClient();
                defaultClient.setUsername("USERNAME");
                defaultClient.setPassword("API_KEY");
                EmailMarketingApi apiInstance = new EmailMarketingApi(defaultClient);
                Integer emailAddressId = 4244; // Integer | Allowed email address id
                try {
                    String result = apiInstance.specificAllowedEmailAddressDelete(emailAddressId);
                    System.out.println(result);
                } catch (ApiException e) {
                    System.err.println("Exception when calling EmailMarketingApi#specificAllowedEmailAddressDelete");
                    e.printStackTrace();
                }
              }
            }
        - lang: Node.js
          source: >-
            var api = require('./api.js');


            var emailMarketingApi = new api.EmailMarketingApi("USERNAME",
            "API_KEY");


            var emailAddressId = 4400;


            emailMarketingApi.specificAllowedEmailAddressDelete(emailAddressId).then(function(response)
            {
              console.log(response.body);
            }).catch(function(err){
              console.error(err.body);
            });
        - lang: Ruby
          source: |-
            # load the gem
            require 'clicksend_client'
            require 'json'

            # setup authorization
            ClickSendClient.configure do |config|
              # Configure HTTP basic authorization: BasicAuth
              config.username = 'USERNAME'
              config.password = 'API_KEY'
            end

            api_instance = ClickSendClient::EmailMarketingApi.new

            email_address_id = 4161 # Integer | Allowed email address id

            begin
              # Delete specific email address
              result = api_instance.specific_allowed_email_address_delete(email_address_id)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling EmailMarketingApi->specific_allowed_email_address_delete: #{e.response_body}"
            end
        - lang: Python
          source: >-
            from __future__ import print_function

            import clicksend_client

            from clicksend_client.rest import ApiException


            # Configure HTTP basic authorization: BasicAuth

            configuration = clicksend_client.Configuration()

            configuration.username = 'USERNAME'

            configuration.password = 'API_KEY'


            # create an instance of the API class

            api_instance =
            clicksend_client.EmailMarketingApi(clicksend_client.ApiClient(configuration))

            email_address_id = 56 # int | Allowed email address id


            try:
                # Delete specific email address
                api_response = api_instance.specific_allowed_email_address_delete(email_address_id)
                print(api_response)
            except ApiException as e:
                print("Exception when calling EmailMarketingApi->specific_allowed_email_address_delete: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::EmailMarketingApi;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


            my $api = WWW::ClickSendClient::EmailMarketingApi->new(username =>
            $username, password => $password);


            my $json_output =
            $api->specific_allowed_email_address_delete('email_address_id' =>
            '1111' );


            print $json_output;
        - lang: objc
          source: >-
            #import "CSEmailMarketingApi.h"


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

            [apiConfig setUsername:@"USERNAME"];

            [apiConfig setPassword:@"PASSWORD"];


            NSNumber *emailId = [[NSNumber alloc] initWithInt:1];

            CSEmailMarketingApi *emailMarketingApiInstance =
            [[CSEmailMarketingApi alloc] init];

            [emailMarketingApiInstance
            specificAllowedEmailAddressDeleteWithEmailAddressId:emailId
            completionHandler:^(NSString *output, NSError *error) {
                if (error) {
                    NSLog(@"Error: %@", error);
                } else {
                    NSLog(@"%@", output);
                }
            }];
        - lang: swift
          source: >-
            import Alamofire


            if let authHeader = Request.authorizationHeader(user: "USERNAME",
            password: "PASSWORD") {
                ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
            }


            EmailMarketingAPI.specificAllowedEmailAddressDelete(emailAddressId:
            1) { (dataString, error) in
                guard let dataString = dataString else {
                    print(error!)
                    return
                }

                if let data = dataString.data(using: String.Encoding.utf8) {
                    do {
                        if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                            print(dictonary)
                        } else {
                            print("Cannot convert the String value to JSON")
                        }
                    } catch let error as NSError {
                        print(error)
                    }
                }
            }
  /v3/email-campaigns/send:
    post:
      summary: Send Email Campaign
      operationId: send-email-campaign
      description: >-
        _Send email campaign_


        Send email campaign


        ### Properties


        | Name | Type | Required | Restrictions | Description |

        | --- | --- | --- | --- | --- |

        | name | string | true | none | Your campaign name. |

        | subject | string | true | none | Your campaign subject. |

        | body | string | true | none | Your campaign message. |

        | from_email_address_id | number | true | none | The allowed email
        address id. |

        | from_name | string | true | none | Your name or business name. |

        | template_id | number | false | none | Your template id. |

        | list_id | number | true | none | Your contact list id. |

        | schedule | integer(int32) | false | none | Your schedule timestamp. |



        Refer to [Status Codes](/#status-codes) for definitions of HTTP status
        code responses.



        <div style="background-color: #FF6A4B; padding: 10px; border-radius:
        8px;">
          <span style="color: white;">This endpoint requires authentication,</span> 
          <a href="/#authentication" style="color: white; text-decoration: underline;">more info...</a>
        </div>
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                subject:
                  type: string
                from_email_address_id:
                  type: string
                template_id:
                  type: string
                list_id:
                  type: string
                from_name:
                  type: string
                draft:
                  type: integer
                custom_string:
                  type: string
                body:
                  type: string
              example:
                name: test campaign
                subject: Test email subject
                from_email_address_id: '{{emailId}}'
                template_id: '{{templateId}}'
                list_id: '{{listId}}'
                from_name: Test Name
                draft: 0
                custom_string: test !@#$%^&*()
                body: <p>it's a test</p>
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/send-email-campaign'
      x-codeSamples:
        - lang: curl
          source: |-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
                 --request POST \
                 --header "Content-Type: application/json" \
                 --data-binary "{
              \"name\" : \"John Doe\",
              \"subject\" : \"Lorem Ipsum\",
              \"from_email_address_id\" : 2,
              \"from_name\" : \"From name\",
              \"template_id\" : 31,
              \"body\" : \"<p>This is a test</p>\",
              \"list_id\" : 456
            }" \
            'https://rest.clicksend.com/v3/email-campaigns/send'
        - lang: PHP
          source: >-
            <?php

            require_once(__DIR__ . '/vendor/autoload.php');


            // Configure HTTP basic authorization: BasicAuth

            $config = ClickSend\Configuration::getDefaultConfiguration()
                          ->setUsername('USERNAME')
                          ->setPassword('API_KEY');

            $apiInstance = new ClickSend\Api\EmailMarketingApi(new
            GuzzleHttp\Client(),$config);

            $email_campaign = new \ClickSend\Model\EmailCampaign(); //
            \ClickSend\Model\EmailCampaign | Email model

            $email_campaign->setName("John Doe");

            $email_campaign->setSubject("Lorem Ipsum");

            $email_campaign->setBody("<p>This is a test</p>");

            $email_campaign->setFromEmailAddressId(4366);

            $email_campaign->setFromName("From name");

            $email_campaign->setTemplateId(4299);

            $email_campaign->setListId(185161);

            $email_campaign->setSchedule(1577012461);


            try {
                $result = $apiInstance->emailCampaignPost($email_campaign);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling EmailMarketingApi->emailCampaignPost: ', $e->getMessage(), PHP_EOL;
            }

            ?>
        - lang: C#
          source: |-
            using IO.ClickSend.ClickSend.Api;
            using IO.ClickSend.Client;
            using IO.ClickSend.ClickSend.Model;

            var configuration = new Configuration()
            {
                Username = USERNAME, 
                Password = API_KEY  
            };
            var emailMarketingApi = new EmailMarketingApi(configuration);
            var emailCampaign = new EmailCampaign(
                name: "My Campaign",
                subject: "This is test Subject",
                body: "This is test body",
                fromEmailAddressId: FROM_EMAIL_ADDRESS_ID,
                fromName: "My Name",
                templateId: TEMPLATE_ID,
                listId: LIST_ID,
                schedule: 1123123
            );
            var response = emailMarketingApi.EmailCampaignPost(emailCampaign);
        - lang: Java
          source: |-
            package ClickSend;

            import java.math.BigDecimal;
            import ClickSend.Api.EmailMarketingApi;
            import ClickSend.Model.EmailCampaign;

            public class send_email_campaign {
              public static void main(String[] args) {
                ApiClient defaultClient = new ApiClient();
                defaultClient.setUsername("USERNAME");
                defaultClient.setPassword("API_KEY");
                EmailMarketingApi apiInstance = new EmailMarketingApi(defaultClient);
                EmailCampaign emailCampaign = new EmailCampaign(); // EmailCampaign | Email model
                emailCampaign.name("name");
                emailCampaign.subject("subject");
                emailCampaign.body("body");
                emailCampaign.fromEmailAddressId(new BigDecimal(4245));
                emailCampaign.fromName("name");
                emailCampaign.templateId(new BigDecimal(4299));
                emailCampaign.listId(new BigDecimal(185161));
                emailCampaign.schedule(new Integer(1545477071));
                try {
                    String result = apiInstance.emailCampaignPost(emailCampaign);
                    System.out.println(result);
                } catch (ApiException e) {
                    System.err.println("Exception when calling EmailMarketingApi#emailCampaignPost");
                    e.printStackTrace();
                }
              }
            }
        - lang: Node.js
          source: >-
            var api = require('./api.js');


            var emailMarketingApi = new api.EmailMarketingApi("USERNAME",
            "API_KEY");


            var emailCampaign = new api.EmailCampaign();


            emailCampaign.name = "name";

            emailCampaign.subject = "subject";

            emailCampaign.body = "body";

            emailCampaign.fromEmailAddressId = 4197;

            emailCampaign.fromName = "bv";

            emailCampaign.templateId = 4299;

            emailCampaign.listId = 185161;


            emailMarketingApi.emailCampaignPost(emailCampaign).then(function(response)
            {
              console.log(response.body);
            }).catch(function(err){
              console.error(err.body);
            });
        - lang: Ruby
          source: |-
            # load the gem
            require 'clicksend_client'
            require 'json'

            # setup authorization
            ClickSendClient.configure do |config|
              # Configure HTTP basic authorization: BasicAuth
              config.username = 'USERNAME'
              config.password = 'API_KEY'
            end

            api_instance = ClickSendClient::EmailMarketingApi.new

            # EmailCampaign | Email model
            email_campaign = ClickSendClient::EmailCampaign.new(
              "schedule": 0,
              "list_id": 123,
              "subject": "subject",
              "from_email_address_id": 1234,
              "name": "name",
              "template_id": 6.027456183070403,
              "body": "body",
              "from_name": "from_name"
            )

            begin
              # Send email campaign
              result = api_instance.email_campaign_post(email_campaign)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling EmailMarketingApi->email_campaign_post: #{e.response_body}"
            end
        - lang: Python
          source: >-
            from __future__ import print_function

            import clicksend_client

            from clicksend_client.rest import ApiException


            # Configure HTTP basic authorization: BasicAuth

            configuration = clicksend_client.Configuration()

            configuration.username = 'USERNAME'

            configuration.password = 'API_KEY'


            # create an instance of the API class

            api_instance =
            clicksend_client.EmailMarketingApi(clicksend_client.ApiClient(configuration))

            email_campaign = clicksend_client.EmailCampaign(
                            name="John Doe",
                            subject="Lorem Ipsum",
                            from_email_address_id=2,
                            from_name="From name",
                            template_id=31,
                            body="<p>This is a test</p>",
                            list_id=185161) # EmailCampaign | Email model

            try:
                # Send email campaign
                api_response = api_instance.email_campaign_post(email_campaign)
                print(api_response)
            except ApiException as e:
                print("Exception when calling EmailMarketingApi->email_campaign_post: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::EmailMarketingApi;

            use WWW::ClickSendClient::Object::EmailCampaign;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


            my $api = WWW::ClickSendClient::EmailMarketingApi->new(username =>
            $username, password => $password);


            my %params = (
                'name'                  => 'name',
                'subject'               => 'subject',
                'body'                  => 'body',
                'from_email_address_id' => 'from_email_address_id',
                'from_name'             => 'from_name',
                'template_id'           => 'template_id',
                'list_id'               => 'list_id',
                'schedule'              => 'schedule'
            );


            my $email_campaign_obj =
            WWW::ClickSendClient::Object::EmailCampaign->new(%params);

            my $json_output = $api->email_campaign_post('email_campaign' =>
            $email_campaign_obj);


            print $json_output;
        - lang: objc
          source: >-
            #import "CSEmailToSmsApi.h"

            #import "CSEmailMarketingApi.h"


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

            [apiConfig setUsername:@"USERNAME"];

            [apiConfig setPassword:@"PASSWORD"];


            CSEmailMarketingApi *emailMarketingApiInstance =
            [[CSEmailMarketingApi alloc] init];

            CSEmailCampaign *emailCampaign = [[CSEmailCampaign alloc] init];

            emailCampaign.name = @"John Doe";

            emailCampaign.subject = @"Lerem ipsum";

            emailCampaign.fromEmailAddressId = @(2);

            emailCampaign.fromName = @"From Name";

            emailCampaign.templateId = @(31);

            emailCampaign.body = @"This is a test";

            emailCampaign.listId = @(456);


            [emailMarketingApiInstance
            emailCampaignPostWithEmailCampaign:emailCampaign
            completionHandler:^(NSString *output, NSError *error) {
                if (error) {
                    NSLog(@"Error: %@", error);
                } else {
                    NSLog(@"%@", output);
                }
            }];
        - lang: swift
          source: >-
            import Alamofire


            if let authHeader = Request.authorizationHeader(user: "USERNAME",
            password: "PASSWORD") {
                ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
            }

            let emailCampaign = EmailCampaign(
                                    name: "name", 
                                    subject: "string", 
                                    body: "string", 
                                    fromEmailAddressId: 1, 
                                    fromName: "string", 
                                    templateId: 2, 
                                    listId: 1, 
                                    schedule: 2
                                )
            EmailMarketingAPI.emailCampaignPost(emailCampaign: emailCampaign,
            completion: { (dataString, error) in
                guard let dataString = dataString else {
                    print(error!)
                    return
                }
                if let data = dataString.data(using: String.Encoding.utf8) {
                    do {
                        if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                            print(dictonary)
                        } else {
                            print("Cannot convert the String value to JSON")
                        }
                    } catch let error as NSError {
                        print(error)
                    }
                }
            })
  /v3/email-campaigns/price:
    post:
      summary: Calculate Email Campaign Price
      operationId: calculate-email-campaign-price
      description: >-
        _Calculate email campaign price_


        Calculate email campaign price


        ### Properties


        | Name | Type | Required | Restrictions | Description |

        | --- | --- | --- | --- | --- |

        | name | string | true | none | Your campaign name. |

        | subject | string | true | none | Your campaign subject. |

        | body | string | true | none | Your campaign message. |

        | from_email_address_id | number | true | none | The allowed email
        address id. |

        | from_name | string | true | none | Your name or business name. |

        | template_id | number | false | none | Your template id. |

        | list_id | number | true | none | Your contact list id. |

        | schedule | integer(int32) | false | none | Your schedule timestamp. |



        Refer to [Status Codes](/#status-codes) for definitions of HTTP status
        code responses.



        <div style="background-color: #FF6A4B; padding: 10px; border-radius:
        8px;">
          <span style="color: white;">This endpoint requires authentication,</span> 
          <a href="/#authentication" style="color: white; text-decoration: underline;">more info...</a>
        </div>
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                subject:
                  type: string
                from_email_address_id:
                  type: string
                template_id:
                  type: string
                list_id:
                  type: string
                from_name:
                  type: string
                draft:
                  type: integer
                schedule:
                  type: string
                custom_string:
                  type: string
                body:
                  type: string
              example:
                name: test campaign
                subject: Test email subject
                from_email_address_id: '{{emailId}}'
                template_id: '{{templateId}}'
                list_id: '{{listId}}'
                from_name: Test Name
                draft: 0
                schedule: '1250165515'
                custom_string: test !@#$%^&*()
                body: <p>it's a test</p>
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/calculate-email-campaign-price'
      x-codeSamples:
        - lang: curl
          source: |-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
                 --request POST \
                 --header "Content-Type: application/json" \
                 --data-binary "{
              \"name\" : \"John Doe\",
              \"subject\" : \"Lorem Ipsum\",
              \"from_email_address_id\" : 2,
              \"from_name\" : \"From name\",
              \"template_id\" : 31,
              \"body\" : \"<p>This is a test</p>\",
              \"list_id\" : 456
            }" \
            'https://rest.clicksend.com/v3/email-campaigns/price'
        - lang: PHP
          source: >-
            <?php

            require_once(__DIR__ . '/vendor/autoload.php');


            // Configure HTTP basic authorization: BasicAuth

            $config = ClickSend\Configuration::getDefaultConfiguration()
                          ->setUsername('USERNAME')
                          ->setPassword('API_KEY');

            $apiInstance = new ClickSend\Api\EmailMarketingApi(new
            GuzzleHttp\Client(),$config);

            $email_campaign = new \ClickSend\Model\EmailCampaign(); //
            \ClickSend\Model\EmailCampaign | Email model

            $email_campaign->setName("John Doe");

            $email_campaign->setSubject("Lorem Ipsum");

            $email_campaign->setBody("<p>This is a test</p>");

            $email_campaign->setFromEmailAddressId(4366);

            $email_campaign->setFromName("From name");

            $email_campaign->setTemplateId(4299);

            $email_campaign->setListId(185161);


            try {
                $result = $apiInstance->emailCampaignPricePost($email_campaign);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling EmailMarketingApi->emailCampaignPricePost: ', $e->getMessage(), PHP_EOL;
            }

            ?>
        - lang: C#
          source: >-
            using IO.ClickSend.ClickSend.Api;

            using IO.ClickSend.Client;

            using IO.ClickSend.ClickSend.Model;


            var configuration = new Configuration()

            {
                Username = USERNAME, 
                Password = API_KEY  
            };

            var emailMarketingApi = new EmailMarketingApi(configuration);

            var emailCampaign = new EmailCampaign(
                name: "My Campaign",
                subject: "This is test Subject",
                body: "This is test body",
                fromEmailAddressId:  FROM_EMAIL_ADDRESS_ID,
                fromName: "My Name",
                templateId: TEMPLATE_ID,
                listId: LIST_ID,
                schedule: 1123123
            );

            var response =
            emailMarketingApi.EmailCampaignPricePost(emailCampaign);
        - lang: Java
          source: |-
            package ClickSend;

            import java.math.BigDecimal;
            import ClickSend.Api.EmailMarketingApi;
            import ClickSend.Model.EmailCampaign;

            public class calculate_email_campaign_price {
              public static void main(String[] args) {
                ApiClient defaultClient = new ApiClient();
                defaultClient.setUsername("USERNAME");
                defaultClient.setPassword("API_KEY");
                EmailMarketingApi apiInstance = new EmailMarketingApi(defaultClient);
                // EmailCampaign | Email model
                EmailCampaign emailCampaign = new EmailCampaign(); 
                emailCampaign.name("name");
                emailCampaign.subject("subject");
                emailCampaign.body("body");
                emailCampaign.fromEmailAddressId(new BigDecimal(4245));
                emailCampaign.fromName("name");
                emailCampaign.templateId(new BigDecimal(4299));
                emailCampaign.listId(new BigDecimal(185161));
                emailCampaign.schedule(new Integer(147852369));
                try {
                    String result = apiInstance.emailCampaignPricePost(emailCampaign);
                    System.out.println(result);
                } catch (ApiException e) {
                    System.err.println("Exception when calling EmailMarketingApi#emailCampaignPricePost");
                    e.printStackTrace();
                }
              }
            }
        - lang: Node.js
          source: >-
            var api = require('./api.js');


            var emailMarketingApi = new api.EmailMarketingApi("USERNAME",
            "API_KEY");


            var emailCampaign = new api.EmailCampaign();


            emailCampaign.name = "name";

            emailCampaign.subject = "subject";

            emailCampaign.body = "body";

            emailCampaign.fromEmailAddressId = 4197;

            emailCampaign.fromName = "bv";

            emailCampaign.templateId = 4299;

            emailCampaign.listId = 185161;

            emailCampaign.schedule = 1546167661;


            emailMarketingApi.emailCampaignPricePost(emailCampaign).then(function(response)
            {
              console.log(response.body);
            }).catch(function(err){
              console.error(err.body);
            });
        - lang: Ruby
          source: |-
            # load the gem
            require 'clicksend_client'
            require 'json'

            # setup authorization
            ClickSendClient.configure do |config|
              # Configure HTTP basic authorization: BasicAuth
              config.username = 'USERNAME'
              config.password = 'API_KEY'
            end

            api_instance = ClickSendClient::EmailMarketingApi.new

            # EmailCampaign | Email model
            email_campaign = ClickSendClient::EmailCampaign.new(
              "schedule": 0,
              "list_id": 123,
              "subject": "subject",
              "from_email_address_id": 1234,
              "name": "name",
              "template_id": 6.027456183070403,
              "body": "body",
              "from_name": "from_name"
            )

            begin
              # Calculate email campaign price
              result = api_instance.email_campaign_price_post(email_campaign)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling EmailMarketingApi->email_campaign_price_post: #{e.response_body}"
            end
        - lang: Python
          source: >-
            from __future__ import print_function

            import clicksend_client

            from clicksend_client.rest import ApiException


            # Configure HTTP basic authorization: BasicAuth

            configuration = clicksend_client.Configuration()

            configuration.username = 'USERNAME'

            configuration.password = 'API_KEY'


            # create an instance of the API class

            api_instance =
            clicksend_client.EmailMarketingApi(clicksend_client.ApiClient(configuration))

            email_campaign = clicksend_client.EmailCampaign(
                                name="John Doe",
                                subject="Lorem Ipsum",
                                from_email_address_id=2,
                                from_name="From name",
                                template_id=31,
                                body="<p>This is a test</p>",
                                list_id=185161) # EmailCampaign | Email model

            try:
                # Calculate email campaign price
                api_response = api_instance.email_campaign_price_post(email_campaign)
                print(api_response)
            except ApiException as e:
                print("Exception when calling EmailMarketingApi->email_campaign_price_post: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::EmailMarketingApi;

            use WWW::ClickSendClient::Object::EmailCampaign;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


            my $api = WWW::ClickSendClient::EmailMarketingApi->new(username =>
            $username, password => $password);


            my %params = (
                'name'                  => 'name',
                'subject'               => '(First Name)(Cust. 2)(Cust. 3)(Cust. 4)(Email Address)',
                'body'                  => 'body',
                'from_email_address_id' => 'from_email_address_id',
                'from_name'             => 'from_name',
                'template_id'           => 'template_id',
                'list_id'               => 'list_id',
                'schedule'              => '0'
            );


            my $email_campaign_obj =
            WWW::ClickSendClient::Object::EmailCampaign->new(%params);


            my $json_output = $api->email_campaign_price_post('email_campaign'
            => $email_campaign_obj);


            print $json_output;
        - lang: objc
          source: >-
            #import "CSEmailMarketingApi.h"


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

            [apiConfig setUsername:@"USERNAME"];

            [apiConfig setPassword:@"PASSWORD"];


            CSEmailCampaign *emailCampaign = [[CSEmailCampaign alloc] init];

            emailCampaign.name = @"John Doe";

            emailCampaign.subject = @"Lerem ipsum";

            emailCampaign.fromEmailAddressId = @(2);

            emailCampaign.fromName = @"From Name";

            emailCampaign.templateId = @(31);

            emailCampaign.body = @"This is a test";

            emailCampaign.listId = @(456);


            CSEmailMarketingApi *emailMarketingApiInstance =
            [[CSEmailMarketingApi alloc] init];

            [emailMarketingApiInstance
            emailCampaignPricePostWithEmailCampaign:emailCampaign 
                                                                completionHandler:^(NSString *output, NSError *error) {
                if (error) {
                    NSLog(@"Error: %@", error);
                } else {
                    NSLog(@"%@", output);
                }
            }];
        - lang: swift
          source: >-
            import Alamofire


            if let authHeader = Request.authorizationHeader(user: "USERNAME",
            password: "PASSWORD") {
                ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
            }


            let emailCampaign = EmailCampaign(name: "tring", 
                                                subject: "string", 
                                                body: "string", 
                                                fromEmailAddressId: 1, 
                                                fromName: "string", 
                                                templateId: 2, 
                                                listId: 1, 
                                                schedule: 2)

            EmailMarketingAPI.emailCampaignPricePost(emailCampaign:
            emailCampaign) { (dataString, error) in
                guard let dataString = dataString else {
                    print(error!)
                    return
                }
                if let data = dataString.data(using: String.Encoding.utf8) {
                    do {
                        if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                            print(dictonary)
                        } else {
                            print("Cannot convert the String value to JSON")
                        }
                    } catch let error as NSError {
                        print(error)
                    }
                }
            }
  /v3/email-campaigns:
    get:
      summary: View All Email Campaigns
      operationId: view-all-email-campaigns
      description: >-
        _Get all email campaigns_


        Get all email campaigns


        ### Parameters


        | Parameter | In | Type | Required | Description |

        | --- | --- | --- | --- | --- |

        | page | query | integer(int32) | false | Page number |

        | limit | query | integer(int32) | false | Number of records per page |



        Refer to [Status Codes](/#status-codes) for definitions of HTTP status
        code responses.



        <div style="background-color: #FF6A4B; padding: 10px; border-radius:
        8px;">
          <span style="color: white;">This endpoint requires authentication,</span> 
          <a href="/#authentication" style="color: white; text-decoration: underline;">more info...</a>
        </div>
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/view-all-email-campaigns'
      x-codeSamples:
        - lang: curl
          source: |-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
            'https://rest.clicksend.com/v3/email-campaigns'
        - lang: PHP
          source: >-
            <?php

            require_once(__DIR__ . '/vendor/autoload.php');


            // Configure HTTP basic authorization: BasicAuth

            $config = ClickSend\Configuration::getDefaultConfiguration()
                          ->setUsername('USERNAME')
                          ->setPassword('API_KEY');

            $apiInstance = new ClickSend\Api\EmailMarketingApi(new
            GuzzleHttp\Client(),$config);

            $page = 1; // int | Page number

            $limit = 10; // int | Number of records per page


            try {
                $result = $apiInstance->emailCampaignsGet($page, $limit);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling EmailMarketingApi->emailCampaignsGet: ', $e->getMessage(), PHP_EOL;
            }

            ?>
        - lang: C#
          source: |-
            using IO.ClickSend.ClickSend.Api;
            using IO.ClickSend.Client;
            using IO.ClickSend.ClickSend.Model;

            var configuration = new Configuration()
            {
                Username = USERNAME, 
                Password = API_KEY  
            };
            var emailMarketingApi = new EmailMarketingApi(configuration);
            var response = emailMarketingApi.EmailCampaignsGet();
        - lang: Java
          source: |-
            package ClickSend;

            import ClickSend.Api.EmailMarketingApi;

            public class view_all_email_campaign {
              public static void main(String[] args) {
                ApiClient defaultClient = new ApiClient();
                defaultClient.setUsername("USERNAME");
                defaultClient.setPassword("API_KEY");
                EmailMarketingApi apiInstance = new EmailMarketingApi(defaultClient);
                Integer page = 1; // Integer | Page number
                Integer limit = 10; // Integer | Number of records per page
                try {
                    String result = apiInstance.emailCampaignsGet(page, limit);
                    System.out.println(result);
                } catch (ApiException e) {
                    System.err.println("Exception when calling EmailMarketingApi#emailCampaignsGet");
                    e.printStackTrace();
                }
              }
            }
        - lang: Node.js
          source: >-
            var api = require('./api.js');


            var emailMarketingApi = new api.EmailMarketingApi("USERNAME",
            "API_KEY");


            var page = 1;

            var limit = 10;


            emailMarketingApi.emailCampaignsGet(page,
            limit).then(function(response) {
              console.log(response.body);
            }).catch(function(err){
              console.error(err.body);
            });
        - lang: Ruby
          source: |-
            # load the gem
            require 'clicksend_client'
            require 'json'

            # setup authorization
            ClickSendClient.configure do |config|
              # Configure HTTP basic authorization: BasicAuth
              config.username = 'USERNAME'
              config.password = 'API_KEY'
            end

            api_instance = ClickSendClient::EmailMarketingApi.new

            opts = {
              page: 1,  # Integer | Page number
              limit: 10 # Integer | Number of records per page
            }

            begin
              # Get all email campaigns
              result = api_instance.email_campaigns_get(opts)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling EmailMarketingApi->email_campaigns_get: #{e.response_body}"
            end
        - lang: Python
          source: >-
            from __future__ import print_function

            import clicksend_client

            from clicksend_client.rest import ApiException


            # Configure HTTP basic authorization: BasicAuth

            configuration = clicksend_client.Configuration()

            configuration.username = 'USERNAME'

            configuration.password = 'API_KEY'


            # create an instance of the API class

            api_instance =
            clicksend_client.EmailMarketingApi(clicksend_client.ApiClient(configuration))

            page = 1 # int | Page number (optional) (default to 1)

            limit = 10 # int | Number of records per page (optional) (default to
            10)


            try:
                # Get all email campaigns
                api_response = api_instance.email_campaigns_get(page=page, limit=limit)
                print(api_response)
            except ApiException as e:
                print("Exception when calling EmailMarketingApi->email_campaigns_get: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::EmailMarketingApi;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


            my $api = WWW::ClickSendClient::EmailMarketingApi->new(username =>
            $username, password => $password);


            my $json_output = $api->email_campaigns_get('page' => '1', 'limit'
            => '123');


            print $json_output;
        - lang: objc
          source: >-
            #import "CSEmailMarketingApi.h"


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

            [apiConfig setUsername:@"USERNAME"];

            [apiConfig setPassword:@"PASSWORD"];


            NSNumber *page = [[NSNumber alloc] initWithInt:1];

            NSNumber *limit =[[NSNumber alloc] initWithInt:15];

            CSEmailMarketingApi *emailMarketingApiInstance =
            [[CSEmailMarketingApi alloc] init];

            [emailMarketingApiInstance emailCampaignsGetWithPage:page
            limit:limit completionHandler:^(NSString *output, NSError *error) {
                if (error) {
                    NSLog(@"Error: %@", error);
                } else {
                    NSLog(@"%@", output);
                }
            }];
        - lang: swift
          source: >-
            import Alamofire


            if let authHeader = Request.authorizationHeader(user: "USERNAME",
            password: "PASSWORD") {
                ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
            }

            EmailMarketingAPI.emailCampaignsGet(page: 1, limit: 15) {
            (dataString, error) in
                guard let dataString = dataString else {
                    print(error!)
                    return
                }
                if let data = dataString.data(using: String.Encoding.utf8) {
                    do {
                        if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                            print(dictonary)
                        } else {
                            print("Cannot convert the String value to JSON")
                        }
                    } catch let error as NSError {
                        print(error)
                    }
                }
            }
  /v3/email-campaigns/{email_campaign_id}:
    get:
      summary: View Email Campaign
      operationId: view-email-campaign
      description: >-
        _Get specific email campaign_


        Get specific email campaign


        Refer to [Status Codes](/#status-codes) for definitions of HTTP status
        code responses.


        <div style="background-color: #FF6A4B; padding: 10px; border-radius:
        8px;">
          <span style="color: white;">This endpoint requires authentication,</span> 
          <a href="/#authentication" style="color: white; text-decoration: underline;">more info...</a>
        </div>
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
        - name: email_campaign_id
          in: path
          schema:
            type: string
          required: true
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/view-email-campaign'
      x-codeSamples:
        - lang: curl
          source: |-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
            'https://rest.clicksend.com/v3/email-campaigns/{email_campaign_id}'
        - lang: PHP
          source: >-
            <?php

            require_once(__DIR__ . '/vendor/autoload.php');


            // Configure HTTP basic authorization: BasicAuth

            $config = ClickSend\Configuration::getDefaultConfiguration()
                          ->setUsername('USERNAME')
                          ->setPassword('API_KEY');

            $apiInstance = new ClickSend\Api\EmailMarketingApi(new
            GuzzleHttp\Client(),$config);

            $email_campaign_id = 6805; // int | Allowed email campaign id


            try {
                $result = $apiInstance->emailCampaignGet($email_campaign_id);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling EmailMarketingApi->emailCampaignGet: ', $e->getMessage(), PHP_EOL;
            }

            ?>
        - lang: C#
          source: |-
            using IO.ClickSend.ClickSend.Api;
            using IO.ClickSend.Client;
            using IO.ClickSend.ClickSend.Model;

            var configuration = new Configuration()
            {
                Username = USERNAME, 
                Password = API_KEY  
            };
            var emailMarketingApi = new EmailMarketingApi(configuration);
            var response = emailMarketingApi.EmailCampaignGet(CAMPAIGN_ID);
        - lang: Java
          source: |-
            package ClickSend;

            import ClickSend.Api.EmailMarketingApi;

            public class view_specific_email_campaign {
              public static void main(String[] args) {
                ApiClient defaultClient = new ApiClient();
                defaultClient.setUsername("USERNAME");
                defaultClient.setPassword("API_KEY");
                EmailMarketingApi apiInstance = new EmailMarketingApi(defaultClient);
                Integer emailCampaignId = 6676; // Integer | Allowed email campaign id
                try {
                    String result = apiInstance.emailCampaignGet(emailCampaignId);
                    System.out.println(result);
                } catch (ApiException e) {
                    System.err.println("Exception when calling EmailMarketingApi#emailCampaignGet");
                    e.printStackTrace();
                }
              }
            }
        - lang: Node.js
          source: >-
            var api = require('./api.js');


            var emailMarketingApi = new api.EmailMarketingApi("USERNAME",
            "API_KEY");


            var emailCampaignId = 7196;


            emailMarketingApi.emailCampaignGet(emailCampaignId).then(function(response)
            {
              console.log(response.body);
            }).catch(function(err){
              console.error(err.body);
            });
        - lang: Ruby
          source: |-
            # load the gem
            require 'clicksend_client'
            require 'json'

            # setup authorization
            ClickSendClient.configure do |config|
              # Configure HTTP basic authorization: BasicAuth
              config.username = 'USERNAME'
              config.password = 'API_KEY'
            end

            api_instance = ClickSendClient::EmailMarketingApi.new

            email_campaign_id = 56 # Integer | Allowed email campaign id

            begin
              # Get specific email campaign
              result = api_instance.email_campaign_get(email_campaign_id)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling EmailMarketingApi->email_campaign_get: #{e.response_body}"
            end
        - lang: Python
          source: >-
            from __future__ import print_function

            import clicksend_client

            from clicksend_client.rest import ApiException


            # Configure HTTP basic authorization: BasicAuth

            configuration = clicksend_client.Configuration()

            configuration.username = 'USERNAME'

            configuration.password = 'API_KEY'


            # create an instance of the API class

            api_instance =
            clicksend_client.EmailMarketingApi(clicksend_client.ApiClient(configuration))

            email_campaign_id = 56 # int | Allowed email campaign id


            try:
                # Get specific email campaign
                api_response = api_instance.email_campaign_get(email_campaign_id)
                print(api_response)
            except ApiException as e:
                print("Exception when calling EmailMarketingApi->email_campaign_get: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::EmailMarketingApi;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


            my $api = WWW::ClickSendClient::EmailMarketingApi->new(username =>
            $username, password => $password);


            my $json_output = $api->email_campaign_get('email_campaign_id' =>
            '123');


            print $json_output;
        - lang: objc
          source: >-
            #import "CSEmailMarketingApi.h"


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

            [apiConfig setUsername:@"USERNAME"];

            [apiConfig setPassword:@"PASSWORD"];


            NSNumber *emailCampaignId = [[NSNumber alloc] initWithInt:1];

            CSEmailMarketingApi *emailMarketingApiInstance =
            [[CSEmailMarketingApi alloc] init];

            [emailMarketingApiInstance
            emailCampaignGetWithEmailCampaignId:emailCampaignId
            completionHandler:^(NSString *output, NSError *error) {
                if (error) {
                    NSLog(@"Error: %@", error);
                } else {
                    NSLog(@"%@", output);
                }
            }];
        - lang: swift
          source: >-
            import Alamofire


            if let authHeader = Request.authorizationHeader(user: "USERNAME",
            password: "PASSWORD") {
                ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
            }


            EmailMarketingAPI.emailCampaignGet(emailCampaignId: 1) {
            (dataString, error) in
                guard let dataString = dataString else {
                    print(error!)
                    return
                }
                if let data = dataString.data(using: String.Encoding.utf8) {
                    do {
                        if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                            print(dictonary)
                        } else {
                            print("Cannot convert the String value to JSON")
                        }
                    } catch let error as NSError {
                        print(error)
                    }
                }
            }
    put:
      summary: Update Email Campaign
      operationId: update-email-campaign
      description: >-
        _Edit email campaign_


        Edit email campaign


        ### Parameters


        | Parameter | In | Type | Required | Description |

        | --- | --- | --- | --- | --- |

        | email_campaign_id | path | integer(int32) | true | Allowed email
        campaign id |



        Refer to [Status Codes](/#status-codes) for definitions of HTTP status
        code responses.



        <div style="background-color: #FF6A4B; padding: 10px; border-radius:
        8px;">
          <span style="color: white;">This endpoint requires authentication,</span> 
          <a href="/#authentication" style="color: white; text-decoration: underline;">more info...</a>
        </div>
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                schedule:
                  type: integer
                list_id:
                  type: integer
                subject:
                  type: string
                from_email_address_id:
                  type: integer
                name:
                  type: string
                template_id:
                  type: integer
                body:
                  type: string
                from_name:
                  type: string
              example:
                schedule: 0
                list_id: 123
                subject: subject
                from_email_address_id: 4062
                name: name
                template_id: 4077
                body: body
                from_name: from_name
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
        - name: email_campaign_id
          in: path
          schema:
            type: string
          required: true
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/update-email-campaign'
      x-codeSamples:
        - lang: curl
          source: |-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
                 --request PUT \
                 --header "Content-Type: application/json" \
                 --data-binary "{
              \"name\" : \"John Doe\",
              \"subject\" : \"Lorem Ipsum\",
              \"from_email_address_id\" : 2,
              \"from_name\" : \"From name\",
              \"template_id\" : 31,
              \"body\" : \"<p>This is a test</p>\",
              \"list_id\" : 456
            }" \
            'https://rest.clicksend.com/v3/email-campaigns/{email_campaign_id}'
        - lang: PHP
          source: >-
            <?php

            require_once(__DIR__ . '/vendor/autoload.php');


            // Configure HTTP basic authorization: BasicAuth

            $config = ClickSend\Configuration::getDefaultConfiguration()
                          ->setUsername('USERNAME')
                          ->setPassword('API_KEY');

            $apiInstance = new ClickSend\Api\EmailMarketingApi(new
            GuzzleHttp\Client(),$config);

            $email_campaign_id = 7538; // int | Allowed email campaign id

            $email_campaign = new \ClickSend\Model\EmailCampaign(); //
            \ClickSend\Model\EmailCampaign | Email model

            $email_campaign->setName("John Doe");

            $email_campaign->setSubject("Lorem Ipsum");

            $email_campaign->setBody("<p>This is a test</p>");

            $email_campaign->setFromEmailAddressId(4366);

            $email_campaign->setFromName("From name");

            $email_campaign->setTemplateId(4299);

            $email_campaign->setListId(185161);


            try {
                $result = $apiInstance->emailCampaignPut($email_campaign_id, $email_campaign);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling EmailMarketingApi->emailCampaignPut: ', $e->getMessage(), PHP_EOL;
            }

            ?>
        - lang: C#
          source: >-
            using IO.ClickSend.ClickSend.Api;

            using IO.ClickSend.Client;

            using IO.ClickSend.ClickSend.Model;


            var configuration = new Configuration()

            {
                Username = USERNAME, 
                Password = API_KEY  
            };

            var emailMarketingApi = new EmailMarketingApi(configuration);

            var emailCampaign = new EmailCampaign(
                name: "My Campaign",
                subject: "This is test Subject",
                body: "This is test body",
                fromEmailAddressId:  FROM_EMAIL_ADDRESS_ID,
                fromName: "My Name",
                templateId: TEMPLATE_ID,
                listId: LIST_ID,
                schedule: 1123123
            );

            var response = emailMarketingApi.EmailCampaignPut(CAMPAIGN_ID,
            emailCampaign);
        - lang: Java
          source: |-
            package ClickSend;

            import java.math.BigDecimal;
            import ClickSend.Api.EmailMarketingApi;
            import ClickSend.Model.EmailCampaign;

            public class update_email_campaign {
              public static void main(String[] args) {
                ApiClient defaultClient = new ApiClient();
                defaultClient.setUsername("USERNAME");
                defaultClient.setPassword("API_KEY");
                EmailMarketingApi apiInstance = new EmailMarketingApi(defaultClient);
                Integer emailCampaignId = 6804; // Integer | Allowed email campaign id
                // EmailCampaign | Email model
                EmailCampaign emailCampaign = new EmailCampaign(); 
                emailCampaign.name("name");
                emailCampaign.subject("subject");
                emailCampaign.body("body");
                emailCampaign.fromEmailAddressId(new BigDecimal(4245));
                emailCampaign.fromName("name");
                emailCampaign.templateId(new BigDecimal(4299));
                emailCampaign.listId(new BigDecimal(185161));
                emailCampaign.schedule(new Integer(147852369));
                try {
                    String result = apiInstance.emailCampaignPut(emailCampaignId, emailCampaign);
                    System.out.println(result);
                } catch (ApiException e) {
                    System.err.println("Exception when calling EmailMarketingApi#emailCampaignPut");
                    e.printStackTrace();
                }
              }
            }
        - lang: Node.js
          source: >-
            var api = require('./api.js');


            var emailMarketingApi = new api.EmailMarketingApi("USERNAME",
            "API_KEY");


            var emailCampaignId = 7197;


            var emailCampaign = new api.EmailCampaign();


            emailCampaign.name = "name";

            emailCampaign.subject = "subject";

            emailCampaign.body = "body";

            emailCampaign.fromEmailAddressId = 4197;

            emailCampaign.fromName = "bv";

            emailCampaign.templateId = 4299;

            emailCampaign.listId = 185161;


            emailMarketingApi.emailCampaignPut(emailCampaignId,
            emailCampaign).then(function(response) {
              console.log(response.body);
            }).catch(function(err){
              console.error(err.body);
            });
        - lang: Ruby
          source: |-
            # load the gem
            require 'clicksend_client'
            require 'json'

            # setup authorization
            ClickSendClient.configure do |config|
              # Configure HTTP basic authorization: BasicAuth
              config.username = 'USERNAME'
              config.password = 'API_KEY'
            end

            api_instance = ClickSendClient::EmailMarketingApi.new

            email_campaign_id = 56 # Integer | Allowed email campaign id

            # EmailCampaign | Email model
            email_campaign = ClickSendClient::EmailCampaign.new(
              "schedule": 0,
              "list_id": 123,
              "subject": "subject",
              "from_email_address_id": 4062,
              "name": "name",
              "template_id": 4077,
              "body": "body",
              "from_name": "from_name"
            )

            begin
              # Edit email campaign
              result = api_instance.email_campaign_put(email_campaign_id, email_campaign)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling EmailMarketingApi->email_campaign_put: #{e.response_body}"
            end
        - lang: Python
          source: >-
            from __future__ import print_function

            import clicksend_client

            from clicksend_client.rest import ApiException


            # Configure HTTP basic authorization: BasicAuth

            configuration = clicksend_client.Configuration()

            configuration.username = 'USERNAME'

            configuration.password = 'API_KEY'


            # create an instance of the API class

            api_instance =
            clicksend_client.EmailMarketingApi(clicksend_client.ApiClient(configuration))

            email_campaign_id = 56 # int | Allowed email campaign id

            email_campaign = clicksend_client.EmailCampaign(
                            name="John Doe",
                            subject="Lorem Ipsum",
                            from_email_address_id=2,
                            from_name="From name",
                            template_id=31,
                            body="<p>This is a test</p>",
                            list_id=185161) # EmailCampaign | Email model

            try:
                # Edit email campaign
                api_response = api_instance.email_campaign_put(email_campaign_id, email_campaign)
                print(api_response)
            except ApiException as e:
                print("Exception when calling EmailMarketingApi->email_campaign_put: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::EmailMarketingApi;

            use WWW::ClickSendClient::Object::EmailCampaign;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


            my $api = WWW::ClickSendClient::EmailMarketingApi->new(username =>
            $username, password => $password);


            my %params = (
                'name'                  => 'name',
                'subject'               => 'subject',
                'body'                  => 'body',
                'from_email_address_id' => 'from_email_address_id',
                'from_name'             => 'from_name',
                'template_id'           => 'template_id',
                'list_id'               => 'list_id',
                'schedule'              => '0'
            );


            my $email_campaign_obj =
            WWW::ClickSendClient::Object::EmailCampaign->new(%params);

            my $json_output = $api->email_campaign_put('email_campaign_id' =>
            '1234', 'email_campaign' => $email_campaign_obj);


            print $json_output;
        - lang: objc
          source: >-
            #import "CSEmailMarketingApi.h"


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

            [apiConfig setUsername:@"USERNAME"];

            [apiConfig setPassword:@"PASSWORD"];


            NSNumber *emailId = [[NSNumber alloc] initWithInt:1];

            CSEmailCampaign *emailCampaign = [[CSEmailCampaign alloc] init];

            emailCampaign.name = @"John Doe";

            emailCampaign.subject = @"Lerem ipsum";

            emailCampaign.fromEmailAddressId = @(2);

            emailCampaign.fromName = @"From Name";

            emailCampaign.templateId = @(31);

            emailCampaign.body = @"This is a test";

            emailCampaign.listId = @(456);


            CSEmailMarketingApi *emailMarketingApiInstance =
            [[CSEmailMarketingApi alloc] init];

            [emailMarketingApiInstance
            emailCampaignPutWithEmailCampaignId:emailId
            emailCampaign:emailCampaign  completionHandler:^(NSString *output,
            NSError *error) {
                if (error) {
                    NSLog(@"Error: %@", error);
                } else {
                    NSLog(@"%@", output);
                }
            }];
        - lang: swift
          source: >-
            import Alamofire


            if let authHeader = Request.authorizationHeader(user: "USERNAME",
            password: "PASSWORD") {
                ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
            }


            let emailCampaign = EmailCampaign(
                                    name: "John Doe", 
                                    subject: "Lerem ipsum", 
                                    body: "Lerem ipsum", 
                                    fromEmailAddressId: 2, 
                                    fromName: "string", 
                                    templateId: 2, 
                                    listId: 1, 
                                    schedule: 2
                                )
            EmailMarketingAPI.emailCampaignPut(emailCampaignId: 1,
            emailCampaign: emailCampaign) { (dataString, error) in
                guard let dataString = dataString else {
                    print(error!)
                    return
                }
                if let data = dataString.data(using: String.Encoding.utf8) {
                    do {
                        if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                            print(dictonary)
                        } else {
                            print("Cannot convert the String value to JSON")
                        }
                    } catch let error as NSError {
                        print(error)
                    }
                }
            }
  /v3/email-campaigns/{email_campaign_id}/cancel:
    put:
      summary: Cancel Email Campaign
      operationId: cancel-email-campaign
      description: >-
        _Cancel email campaign_


        Cancel email campaign


        ### Parameters


        | Parameter | In | Type | Required | Description |

        | --- | --- | --- | --- | --- |

        | email_campaign_id | path | integer(int32) | true | Allowed email
        campaign id |

        | date_from | query | integer(int32) | false | Start date (Unix
        Timestamp e.g. 1436849372) |

        | date_to | query | integer(int32) | false | End date (Unix Timestamp
        e.g. 1436879372) |

        | page | query | integer(int32) | false | [Page number](/#pagination) |

        | limit | query | integer(int32) | false | [Number of records per
        page](/#pagination) |



        Refer to [Status Codes](/#status-codes) for definitions of HTTP status
        code responses.



        <div style="background-color: #FF6A4B; padding: 10px; border-radius:
        8px;">
          <span style="color: white;">This endpoint requires authentication,</span> 
          <a href="/#authentication" style="color: white; text-decoration: underline;">more info...</a>
        </div>
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                name:
                  type: string
                subject:
                  type: string
                from_email_address_id:
                  type: integer
                template_id:
                  type: integer
                list_id:
                  type: integer
                from_name:
                  type: string
                draft:
                  type: integer
                schedule:
                  type: string
                custom_string:
                  type: string
                body:
                  type: string
              example:
                name: test campaign
                subject: Test email subject
                from_email_address_id: 1
                template_id: 67
                list_id: 285
                from_name: Test Name
                draft: 0
                schedule: '1250165515'
                custom_string: test !@#$%^&*()
                body: <p>it's a test</p>
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
        - name: email_campaign_id
          in: path
          schema:
            type: string
          required: true
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/cancel-email-campaign'
      x-codeSamples:
        - lang: curl
          source: >-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
                 --request PUT \
            'https://rest.clicksend.com/v3/email-campaigns/{email_campaign_id}/cancel'
        - lang: PHP
          source: >-
            <?php

            require_once(__DIR__ . '/vendor/autoload.php');


            // Configure HTTP basic authorization: BasicAuth

            $config = ClickSend\Configuration::getDefaultConfiguration()
                          ->setUsername('USERNAME')
                          ->setPassword('API_KEY');

            $apiInstance = new ClickSend\Api\EmailMarketingApi(new
            GuzzleHttp\Client(),$config);

            $email_campaign_id = 7103; // int | Allowed email campaign id


            try {
                $result = $apiInstance->cancelEmailCampaignPut($email_campaign_id);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling EmailMarketingApi->cancelEmailCampaignPut: ', $e->getMessage(), PHP_EOL;
            }

            ?>
        - lang: C#
          source: >-
            using IO.ClickSend.ClickSend.Api;

            using IO.ClickSend.Client;

            using IO.ClickSend.ClickSend.Model;


            var configuration = new Configuration()

            {
                Username = USERNAME, 
                Password = API_KEY  
            };

            var emailMarketingApi = new EmailMarketingApi(configuration);

            var response =
            emailMarketingApi.CancelEmailCampaignPut(EMAIL_CAMPAIGN_ID);
        - lang: Java
          source: |
            package ClickSend;

            import ClickSend.Api.EmailMarketingApi;

            public class cancel_email_campaign {
              public static void main(String[] args) {
                ApiClient defaultClient = new ApiClient();
                defaultClient.setUsername("USERNAME");
                defaultClient.setPassword("API_KEY");
                EmailMarketingApi apiInstance = new EmailMarketingApi(defaultClient);
                Integer emailCampaignId = 6805; // Integer | Allowed email campaign id
                try {
                    String result = apiInstance.cancelEmailCampaignPut(emailCampaignId);
                    System.out.println(result);
                } catch (ApiException e) {
                    System.err.println("Exception when calling EmailMarketingApi#cancelEmailCampaignPut");
                    e.printStackTrace();
                }
              }
            }
        - lang: Node.js
          source: >-
            var api = require('./api.js');


            var emailMarketingApi = new api.EmailMarketingApi("USERNAME",
            "API_KEY");


            var emailCampaignId = 7197;


            emailMarketingApi.cancelEmailCampaignPut(emailCampaignId).then(function(response)
            {
              console.log(response.body);
            }).catch(function(err){
              console.error(err.body);
            });
        - lang: Ruby
          source: |-
            # load the gem
            require 'clicksend_client'
            require 'json'

            # setup authorization
            ClickSendClient.configure do |config|
              # Configure HTTP basic authorization: BasicAuth
              config.username = 'USERNAME'
              config.password = 'API_KEY'
            end

            api_instance = ClickSendClient::EmailMarketingApi.new

            email_campaign_id = 56 # Integer | Allowed email campaign id

            begin
              # Cancel email campaign
              result = api_instance.cancel_email_campaign_put(email_campaign_id)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling EmailMarketingApi->cancel_email_campaign_put: #{e.response_body}"
            end
        - lang: Python
          source: >-
            from __future__ import print_function

            import clicksend_client

            from clicksend_client.rest import ApiException


            # Configure HTTP basic authorization: BasicAuth

            configuration = clicksend_client.Configuration()

            configuration.username = 'USERNAME'

            configuration.password = 'API_KEY'


            # create an instance of the API class

            api_instance =
            clicksend_client.EmailMarketingApi(clicksend_client.ApiClient(configuration))

            email_campaign_id = 56 # int | Allowed email campaign id


            try:
                # Cancel email campaign
                api_response = api_instance.cancel_email_campaign_put(email_campaign_id)
                print(api_response)
            except ApiException as e:
                print("Exception when calling EmailMarketingApi->cancel_email_campaign_put: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::EmailMarketingApi;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


            my $api = WWW::ClickSendClient::EmailMarketingApi->new(username =>
            $username, password => $password);


            my $json_output =
            $api->cancel_email_campaign_put('email_campaign_id' => '1234');


            print $json_output;
        - lang: objc
          source: >-
            #import "CSEmailMarketingApi.h"


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

            [apiConfig setUsername:@"USERNAME"];

            [apiConfig setPassword:@"PASSWORD"];


            NSNumber *emailCampaignId =[[NSNumber alloc] initWithInt:1];

            CSEmailMarketingApi *emailMarketingApiInstance =
            [[CSEmailMarketingApi alloc] init];

            [emailMarketingApiInstance
            cancelEmailCampaignPutWithEmailCampaignId:emailCampaignId 
                                                                completionHandler:^(NSString *output, NSError *error) {
                if (error) {
                    NSLog(@"Error: %@", error);
                } else {
                    NSLog(@"%@", output);
                }
            }];
        - lang: swift
          source: >-
            import Alamofire


            if let authHeader = Request.authorizationHeader(user: "USERNAME",
            password: "PASSWORD") {
                ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
            }

            EmailMarketingAPI.cancelEmailCampaignPut(emailCampaignId: 1) {
            (dataString, error) in
                guard let dataString = dataString else {
                    print(error!)
                    return
                }
                if let data = dataString.data(using: String.Encoding.utf8) {
                    do {
                        if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                            print(dictonary)
                        } else {
                            print("Cannot convert the String value to JSON")
                        }
                    } catch let error as NSError {
                        print(error)
                    }
                }
            }
  /v3/email-campaigns/{email_campaign_id}/history:
    get:
      summary: View Email Campaign History
      operationId: view-email-campaign-history
      description: >-
        _Get specific email campaign history_


        Get specific email campaign history



        Refer to [Status Codes](/#status-codes) for definitions of HTTP status
        code responses.



        <div style="background-color: #FF6A4B; padding: 10px; border-radius:
        8px;">
          <span style="color: white;">This endpoint requires authentication,</span> 
          <a href="/#authentication" style="color: white; text-decoration: underline;">more info...</a>
        </div>
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
        - name: email_campaign_id
          in: path
          schema:
            type: string
          required: true
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/view-email-campaign-history'
      x-codeSamples:
        - lang: curl
          source: >-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
            'https://rest.clicksend.com/v3/email-campaigns/{campaign_id}/history'
        - lang: PHP
          source: >-
            <?php

            require_once(__DIR__ . '/vendor/autoload.php');


            // Configure HTTP basic authorization: BasicAuth

            $config = ClickSend\Configuration::getDefaultConfiguration()
                          ->setUsername('USERNAME')
                          ->setPassword('API_KEY');

            $apiInstance = new ClickSend\Api\EmailMarketingApi(new
            GuzzleHttp\Client(),$config);

            $email_campaign_id = 7102; // int | Allowed email campaign id

            $date_from = '1436849372'; // int | Start date

            $date_to = '1436899372'; // int | End date

            $page = 1; // int | Page number

            $limit = 10; // int | Number of records per page


            try {
                $result = $apiInstance->emailCampaignHistoryGet($email_campaign_id, $date_from, $date_to, $page, $limit);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling EmailMarketingApi->emailCampaignHistoryGet: ', $e->getMessage(), PHP_EOL;
            }

            ?>
        - lang: C#
          source: >-
            using IO.ClickSend.ClickSend.Api;

            using IO.ClickSend.Client;

            using IO.ClickSend.ClickSend.Model;


            var configuration = new Configuration()

            {
                Username = USERNAME, 
                Password = API_KEY  
            };

            var emailMarketingApi = new EmailMarketingApi(configuration);

            var response =
            emailMarketingApi.EmailCampaignHistoryGet(EMAIL_CAMPAIGN_ID);
        - lang: Java
          source: |-
            package ClickSend;

            import ClickSend.Api.EmailMarketingApi;

            public class view_email_campaign_history {
              public static void main(String[] args) {
                ApiClient defaultClient = new ApiClient();
                defaultClient.setUsername("USERNAME");
                defaultClient.setPassword("API_KEY");
                EmailMarketingApi apiInstance = new EmailMarketingApi(defaultClient);
                Integer emailCampaignId = 6804; // Integer | Allowed email campaign id
                Integer dateFrom = 1436849372; // Integer | Start date
                Integer dateTo = 1436879372; // Integer | End date
                Integer page = 1; // Integer | Page number
                Integer limit = 10; // Integer | Number of records per page
                try {
                    String result = apiInstance.emailCampaignHistoryGet(emailCampaignId, dateFrom, dateTo, page, limit);
                    System.out.println(result);
                } catch (ApiException e) {
                    System.err.println("Exception when calling EmailMarketingApi#emailCampaignHistoryGet");
                    e.printStackTrace();
                }
              }
            }
        - lang: Node.js
          source: >-
            var api = require('./api.js');


            var emailMarketingApi = new api.EmailMarketingApi("USERNAME",
            "API_KEY");


            var emailCampaignId = 7196;

            var dateFrom = '1436479372';

            var dateTo = '1436879372';

            var page = 1;

            var limit = 10;


            emailMarketingApi.emailCampaignHistoryGet(emailCampaignId, dateFrom,
            dateTo, page, limit).then(function(response) {
              console.log(response.body);
            }).catch(function(err){
              console.error(err.body);
            });
        - lang: Ruby
          source: |-
            # load the gem
            require 'clicksend_client'
            require 'json'

            # setup authorization
            ClickSendClient.configure do |config|
              # Configure HTTP basic authorization: BasicAuth
              config.username = 'USERNAME'
              config.password = 'API_KEY'
            end

            api_instance = ClickSendClient::EmailMarketingApi.new

            email_campaign_id = 6594 # Integer | Allowed email campaign id

            opts = {
              date_from: 1436849372, # Integer | Start date
              date_to: 1436879372,   # Integer | End date
              page: 1,       # Integer | Page number
              limit: 10      # Integer | Number of records per page
            }

            begin
              # Get specific email campaign history
              result = api_instance.email_campaign_history_get(email_campaign_id, opts)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling EmailMarketingApi->email_campaign_history_get: #{e.response_body}"
            end
        - lang: Python
          source: >-
            from __future__ import print_function

            import clicksend_client

            from clicksend_client.rest import ApiException


            # Configure HTTP basic authorization: BasicAuth

            configuration = clicksend_client.Configuration()

            configuration.username = 'USERNAME'

            configuration.password = 'API_KEY'


            # create an instance of the API class

            api_instance =
            clicksend_client.EmailMarketingApi(clicksend_client.ApiClient(configuration))

            email_campaign_id = 56 # int | Allowed email campaign id

            date_from = 1436849372 # int | Start date (optional)

            date_to = 1436879372 # int | End date (optional)

            page = 1 # int | Page number (optional) (default to 1)

            limit = 10 # int | Number of records per page (optional) (default to
            10)


            try:
                # Get specific email campaign history
                api_response = api_instance.email_campaign_history_get(email_campaign_id, date_from=date_from, date_to=date_to, page=page, limit=limit)
                print(api_response)
            except ApiException as e:
                print("Exception when calling EmailMarketingApi->email_campaign_history_get: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::EmailMarketingApi;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


            my $api = WWW::ClickSendClient::EmailMarketingApi->new(username =>
            $username, password => $password);

            my $json_output =
            $api->email_campaign_history_get('email_campaign_id' => '123'
            ,'date_from'  => '' ,'date_to' => '','page' => '' ,'limit' => '' );


            print $json_output;
        - lang: objc
          source: >-
            #import "CSEmailMarketingApi.h"


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

            [apiConfig setUsername:@"USERNAME"];

            [apiConfig setPassword:@"PASSWORD"];


            NSNumber *emailId = [[NSNumber alloc] initWithInt:1];

            NSNumber *dateFrom = [[NSNumber alloc] initWithInt:1436849372];

            NSNumber *dateTo = [[NSNumber alloc] initWithInt:1436879372];

            NSNumber *page = [[NSNumber alloc] initWithInt:15];

            NSNumber *limit = [[NSNumber alloc] initWithInt:0];


            CSEmailMarketingApi *emailMarketingApiInstance =
            [[CSEmailMarketingApi alloc] init];

            [emailMarketingApiInstance
            emailCampaignHistoryGetWithEmailCampaignId:emailId  
                                                                        dateFrom:dateFrom 
                                                                        dateTo:dateTo 
                                                                        page:page 
                                                                        limit:limit 
                                                                        completionHandler:^(NSString *output, NSError *error) {
                if (error) {
                    NSLog(@"Error: %@", error);
                } else {
                    NSLog(@"%@", output);
                }
            }];
        - lang: swift
          source: >-
            import Alamofire


            if let authHeader = Request.authorizationHeader(user: "USERNAME",
            password: "PASSWORD") {
                ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
            }


            EmailMarketingAPI.emailCampaignHistoryGet(emailCampaignId: 1, 
                                                        dateFrom: 1436849372, 
                                                        dateTo: 1436879372, 
                                                        page: 1, 
                                                        limit: 15) { (dataString, error) in
                guard let dataString = dataString else {
                    print(error!)
                    return
                }
                if let data = dataString.data(using: String.Encoding.utf8) {
                    do {
                        if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                            print(dictonary)
                        } else {
                            print("Cannot convert the String value to JSON")
                        }
                    } catch let error as NSError {
                        print(error)
                    }
                }
            }
  /v3/email-campaigns/{email_campaign_id}/history/export:
    get:
      summary: Export Email Campaign History
      operationId: export-email-campaign-history
      description: >-
        _Export specific email campaign history_


        Export specific email campaign history


        ### Parameters


        | Parameter | In | Type | Required | Description |

        | --- | --- | --- | --- | --- |

        | email_campaign_id | path | integer(int32) | true | Allowed email
        campaign id |

        | date_from | query | integer(int32) | false | Start date (Unix
        Timestamp e.g. 1436849372) |

        | date_to | query | integer(int32) | false | End date (Unix Timestamp
        e.g. 1436879372) |



        Refer to [Status Codes](/#status-codes) for definitions of HTTP status
        code responses.



        <div style="background-color: #FF6A4B; padding: 10px; border-radius:
        8px;">
          <span style="color: white;">This endpoint requires authentication,</span> 
          <a href="/#authentication" style="color: white; text-decoration: underline;">more info...</a>
        </div>
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
        - name: email_campaign_id
          in: path
          schema:
            type: string
          required: true
      responses:
        '200':
          description: Successful response
          content:
            application/json: {}
      x-codeSamples:
        - lang: curl
          source: >-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
            'https://rest.clicksend.com/v3/email-campaigns/{campaign_id}/history/export'
        - lang: PHP
          source: >-
            <?php

            require_once(__DIR__ . '/vendor/autoload.php');


            // Configure HTTP basic authorization: BasicAuth

            $config = ClickSend\Configuration::getDefaultConfiguration()
                          ->setUsername('USERNAME')
                          ->setPassword('API_KEY');

            $apiInstance = new ClickSend\Api\EmailMarketingApi(new
            GuzzleHttp\Client(),$config);

            $email_campaign_id = 7102; // int | Allowed email campaign id

            $date_from = '1436849372'; // int | Start date

            $date_to = '1436879372'; // int | End date


            try {
                $result = $apiInstance->emailCampaignHistoryExportGet($email_campaign_id, $date_from, $date_to);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling EmailMarketingApi->emailCampaignHistoryExportGet: ', $e->getMessage(), PHP_EOL;
            }

            ?>
        - lang: C#
          source: >-
            using IO.ClickSend.ClickSend.Api;

            using IO.ClickSend.Client;

            using IO.ClickSend.ClickSend.Model;


            var configuration = new Configuration()

            {
                Username = USERNAME, 
                Password = API_KEY  
            };

            var emailMarketingApi = new EmailMarketingApi(configuration);

            var response =
            emailMarketingApi.EmailCampaignHistoryExportGet(CAMPAIGN_ID);
        - lang: Java
          source: |-
            package ClickSend;

            import ClickSend.Api.EmailMarketingApi;

            public class export_email_campaign_history {
              public static void main(String[] args) {
                ApiClient defaultClient = new ApiClient();
                defaultClient.setUsername("USERNAME");
                defaultClient.setPassword("API_KEY");
                EmailMarketingApi apiInstance = new EmailMarketingApi(defaultClient);
                Integer emailCampaignId = 6804; // Integer | Allowed email campaign id
                Integer dateFrom = 1436849372; // Integer | Start date
                Integer dateTo = 1436879372; // Integer | End date
                try {
                    String result = apiInstance.emailCampaignHistoryExportGet(emailCampaignId, dateFrom, dateTo);
                    System.out.println(result);
                } catch (ApiException e) {
                    System.err.println("Exception when calling EmailMarketingApi#emailCampaignHistoryExportGet");
                    e.printStackTrace();
                }
              }
            }
        - lang: Node.js
          source: >-
            var api = require('./api.js');


            var emailMarketingApi = new api.EmailMarketingApi("USERNAME",
            "API_KEY");


            var emailCampaignId = 7196;

            var dateFrom = '1436849372';

            var dateTo = '1436879372';

            var page = 1;

            var limit = 10;


            emailMarketingApi.emailCampaignHistoryExportGet(emailCampaignId,
            dateFrom, dateTo, page, limit).then(function(response) {
              console.log(response.body);
            }).catch(function(err){
              console.error(err.body);
            });
        - lang: Ruby
          source: |-
            # load the gem
            require 'clicksend_client'
            require 'json'

            # setup authorization
            ClickSendClient.configure do |config|
              # Configure HTTP basic authorization: BasicAuth
              config.username = 'USERNAME'
              config.password = 'API_KEY'
            end

            api_instance = ClickSendClient::EmailMarketingApi.new

            email_campaign_id = 56 # Integer | Allowed email campaign id

            opts = {
              date_from: 1436849372, # Integer | Start date
              date_to: 1436879372    # Integer | End date
            }

            begin
              # Export specific email campaign history
              result = api_instance.email_campaign_history_export_get(email_campaign_id, opts)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling EmailMarketingApi->email_campaign_history_export_get: #{e.response_body}"
            end
        - lang: Python
          source: >-
            from __future__ import print_function

            import clicksend_client

            from clicksend_client.rest import ApiException


            # Configure HTTP basic authorization: BasicAuth

            configuration = clicksend_client.Configuration()

            configuration.username = 'USERNAME'

            configuration.password = 'API_KEY'


            # create an instance of the API class

            api_instance =
            clicksend_client.EmailMarketingApi(clicksend_client.ApiClient(configuration))

            email_campaign_id = 56 # int | Allowed email campaign id

            date_from = 1436849372 # int | Start date (optional)

            date_to = 1436879372 # int | End date (optional)


            try:
                # Export specific email campaign history
                api_response = api_instance.email_campaign_history_export_get(email_campaign_id, date_from=date_from, date_to=date_to)
                print(api_response)
            except ApiException as e:
                print("Exception when calling EmailMarketingApi->email_campaign_history_export_get: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::EmailMarketingApi;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


            my $api = WWW::ClickSendClient::EmailMarketingApi->new(username =>
            $username, password => $password);


            my $json_output =
            $api->email_campaign_history_export_get('email_campaign_id' =>
            '1234' ,'date_from'  => '' ,'date_to' => '' );


            print $json_output;
        - lang: objc
          source: >-
            #import "CSEmailMarketingApi.h"


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

            [apiConfig setUsername:@"USERNAME"];

            [apiConfig setPassword:@"PASSWORD"];


            NSNumber *emailId = [[NSNumber alloc] initWithInt:1];

            NSNumber *dateFrom = [[NSNumber alloc] initWithInt:1436849372];

            NSNumber *dateTo = [[NSNumber alloc] initWithInt:1436879372];


            CSEmailMarketingApi *emailMarketingApiInstance =
            [[CSEmailMarketingApi alloc] init];

            [emailMarketingApiInstance
            emailCampaignHistoryExportGetWithEmailCampaignId:emailId
            dateFrom:dateFrom dateTo:dateTo completionHandler:^(NSString
            *output, NSError *error) {
                if (error) {
                    NSLog(@"Error: %@", error);
                } else {
                    NSLog(@"%@", output);
                }
            }];
        - lang: swift
          source: >-
            import Alamofire


            if let authHeader = Request.authorizationHeader(user: "USERNAME",
            password: "PASSWORD") {
                ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
            }


            EmailMarketingAPI.emailCampaignHistoryExportGet(emailCampaignId: 1)
            { (dataString, error) in
                guard let dataString = dataString else {
                    print(error!)
                    return
                }
                if let data = dataString.data(using: String.Encoding.utf8) {
                    do {
                    if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                            print(dictonary)
                        } else {
                            print("Cannot convert the String value to JSON")
                        }
                    } catch let error as NSError {
                        print(error)
                    }
                }
            }
  /v3/email/master-templates:
    get:
      summary: View Master Email Templates
      operationId: view-master-email-templates
      description: >-
        _Get all master email templates._


        Get all master email templates.


        ### Parameters


        | Parameter | In | Type | Required | Description |

        | --- | --- | --- | --- | --- |

        | page | query | integer(int32) | false | Page number |

        | limit | query | integer(int32) | false | Number of records per page |


        Refer to [Status Codes](/#status-codes) for definitions of HTTP status
        code responses.


        <div style="background-color: #FF6A4B; padding: 10px; border-radius:
        8px;">
          <span style="color: white;">This endpoint requires authentication,</span> 
          <a href="/#authentication" style="color: white; text-decoration: underline;">more info...</a>
        </div>
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/view-master-email-templates'
      x-codeSamples:
        - lang: curl
          source: |-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
            'https://rest.clicksend.com/v3/email/master-templates'
        - lang: PHP
          source: >-
            <?php

            require_once(__DIR__ . '/vendor/autoload.php');


            // Configure HTTP basic authorization: BasicAuth

            $config = ClickSend\Configuration::getDefaultConfiguration()
                          ->setUsername('USERNAME')
                          ->setPassword('API_KEY');

            $apiInstance = new ClickSend\Api\MasterEmailTemplatesApi(new
            GuzzleHttp\Client(),$config);

            $page = 1; // int | Page number

            $limit = 10; // int | Number of records per page


            try {
                $result = $apiInstance->masterEmailTemplatesGet($page, $limit);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling MasterEmailTemplatesApi->masterEmailTemplatesGet: ', $e->getMessage(), PHP_EOL;
            }

            ?>
        - lang: C#
          source: >-
            using IO.ClickSend.ClickSend.Api;

            using IO.ClickSend.Client;

            using IO.ClickSend.ClickSend.Model;


            var configuration = new Configuration()

            {
                Username = USERNAME, 
                Password = API_KEY  
            };

            var masterEmailTemplatesApi = new
            MasterEmailTemplatesApi(configuration);

            var response = masterEmailTemplatesApi.MasterEmailTemplatesGet();
        - lang: Java
          source: |-
            package ClickSend;

            import ClickSend.Api.MasterEmailTemplatesApi;

            public class view_all_master_email_template {
              public static void main(String[] args) {
                ApiClient defaultClient = new ApiClient();
                defaultClient.setUsername("USERNAME");
                defaultClient.setPassword("API_KEY");
                MasterEmailTemplatesApi apiInstance = new MasterEmailTemplatesApi(defaultClient);
                Integer page = 1; // Integer | Page number
                Integer limit = 10; // Integer | Number of records per page
                try {
                    String result = apiInstance.masterEmailTemplatesGet(page, limit);
                    System.out.println(result);
                } catch (ApiException e) {
                    System.err.println("Exception when calling MasterEmailTemplatesApi#masterEmailTemplatesGet");
                    e.printStackTrace();
                }
              }
            }
        - lang: Node.js
          source: >-
            var api = require('./api.js');


            var masterEmailTemplateApi = new
            api.MasterEmailTemplatesApi("USERNAME", "API_KEY");


            var page = 1;

            var limit = 10;


            masterEmailTemplateApi.masterEmailTemplatesGet(page,
            limit).then(function(response) {
              console.log(response.body);
            }).catch(function(err){
              console.error(err.body);
            });
        - lang: Ruby
          source: |-
            # load the gem
            require 'clicksend_client'
            require 'json'

            # setup authorization
            ClickSendClient.configure do |config|
              # Configure HTTP basic authorization: BasicAuth
              config.username = 'USERNAME'
              config.password = 'API_KEY'
            end

            api_instance = ClickSendClient::MasterEmailTemplatesApi.new

            opts = {
              page: 1, # Integer | Page number
              limit: 10 # Integer | Number of records per page
            }

            begin
              # Get all master email templates
              result = api_instance.master_email_templates_get(opts)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling MasterEmailTemplatesApi->master_email_templates_get: #{e.response_body}"
            end
        - lang: Python
          source: >-
            from __future__ import print_function

            import clicksend_client

            from clicksend_client.rest import ApiException


            # Configure HTTP basic authorization: BasicAuth

            configuration = clicksend_client.Configuration()

            configuration.username = 'USERNAME'

            configuration.password = 'API_KEY'


            # create an instance of the API class

            api_instance =
            clicksend_client.MasterEmailTemplatesApi(clicksend_client.ApiClient(configuration))

            page = 1 # int | Page number (optional) (default to 1)

            limit = 10 # int | Number of records per page (optional) (default to
            10)


            try:
                # Get all master email templates
                api_response = api_instance.master_email_templates_get(page=page, limit=limit)
                print(api_response)
            except ApiException as e:
                print("Exception when calling MasterEmailTemplatesApi->master_email_templates_get: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::MasterEmailTemplatesApi;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


            my $api =
            WWW::ClickSendClient::MasterEmailTemplatesApi->new(username =>
            $username, password => $password);


            my $json_output = $api->master_email_templates_get('page' =>
            '1','limit' => '1');


            print $json_output;
        - lang: objc
          source: >-
            #import "CSMasterEmailTemplatesApi.h"


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

            [apiConfig setUsername:@"USERNAME"];

            [apiConfig setPassword:@"PASSWORD"];


            NSNumber *page = [[NSNumber alloc] initWithInt:1];

            NSNumber *limit = [[NSNumber alloc] initWithInt:15];


            CSMasterEmailTemplatesApi *masterEmailTemplatesApiInstance =
            [[CSMasterEmailTemplatesApi alloc] init];

            [masterEmailTemplatesApiInstance
            masterEmailTemplatesGetWithPage:page limit:limit
            completionHandler:^(NSString *output, NSError *error) {
                if (error) {
                    NSLog(@"Error: %@", error);
                } else {
                    NSLog(@"%@", output);
                }
            }];
        - lang: swift
          source: >-
            import Alamofire


            if let authHeader = Request.authorizationHeader(user: "USERNAME",
            password: "PASSWORD") {
                ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
            }

            MasterEmailTemplatesAPI.masterEmailTemplatesGet(page: 1, limit: 15)
            { (dataString, error) in
                guard let dataString = dataString else {
                    print(error!)
                    return
                }
                if let data = dataString.data(using: String.Encoding.utf8) {
                    do {
                        if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                            print(dictonary)
                        } else {
                            print("Cannot convert the String value to JSON")
                        }
                    } catch let error as NSError {
                        print(error)
                    }
                }
            }
  /v3/email/master-templates/{template_id}:
    get:
      summary: View Master Email Template
      operationId: view-master-email-template
      description: >-
        _Get specific master email template_


        Get specific master email template


        ### Parameters


        | Parameter | In | Type | Required | Description |

        | --- | --- | --- | --- | --- |

        | template_id | path | integer(int32) | true | Email template id |



        Refer to [Status Codes](/#status-codes) for definitions of HTTP status
        code responses.



        <div style="background-color: #FF6A4B; padding: 10px; border-radius:
        8px;">
          <span style="color: white;">This endpoint requires authentication,</span> 
          <a href="/#authentication" style="color: white; text-decoration: underline;">more info...</a>
        </div>
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
        - name: template_id
          in: path
          schema:
            type: string
          required: true
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/view-master-email-template'
      x-codeSamples:
        - lang: curl
          source: |-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
            'https://rest.clicksend.com/v3/email/master-templates/{template_id}'
        - lang: PHP
          source: >-
            <?php

            require_once(__DIR__ . '/vendor/autoload.php');


            // Configure HTTP basic authorization: BasicAuth

            $config = ClickSend\Configuration::getDefaultConfiguration()
                          ->setUsername('USERNAME')
                          ->setPassword('API_KEY');

            $apiInstance = new ClickSend\Api\MasterEmailTemplatesApi(new
            GuzzleHttp\Client(),$config);

            $template_id = 62; // int | Email template id


            try {
                $result = $apiInstance->masterEmailTemplateGet($template_id);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling MasterEmailTemplatesApi->masterEmailTemplateGet: ', $e->getMessage(), PHP_EOL;
            }

            ?>
        - lang: C#
          source: >-
            using IO.ClickSend.ClickSend.Api;

            using IO.ClickSend.Client;

            using IO.ClickSend.ClickSend.Model;


            var configuration = new Configuration()

            {
                Username = USERNAME, 
                Password = API_KEY  
            };

            var masterEmailTemplatesApi = new
            MasterEmailTemplatesApi(configuration);

            var response =
            masterEmailTemplatesApi.MasterEmailTemplateGet(TEMPLATE_ID);
        - lang: Java
          source: |
            package ClickSend;

            import ClickSend.Api.MasterEmailTemplatesApi;

            public class view_specific_master_email_template {
              public static void main(String[] args) {
                ApiClient defaultClient = new ApiClient();
                defaultClient.setUsername("USERNAME");
                defaultClient.setPassword("API_KEY");
                MasterEmailTemplatesApi apiInstance = new MasterEmailTemplatesApi(defaultClient);
                Integer templateId = 63; // Integer | Email template id
                try {
                    String result = apiInstance.masterEmailTemplateGet(templateId);
                    System.out.println(result);
                } catch (ApiException e) {
                    System.err.println("Exception when calling MasterEmailTemplatesApi#masterEmailTemplateGet");
                    e.printStackTrace();
                }
              }
            }
        - lang: Node.js
          source: >-
            var api = require('./api.js');


            var masterEmailTemplateApi = new
            api.MasterEmailTemplatesApi("USERNAME", "API_KEY");


            var templateId = 1;


            masterEmailTemplateApi.masterEmailTemplateGet(templateId).then(function(response)
            {
              console.log(response.body);
            }).catch(function(err){
              console.error(err.body);
            });
        - lang: Ruby
          source: |-
            # load the gem
            require 'clicksend_client'
            require 'json'

            # setup authorization
            ClickSendClient.configure do |config|
              # Configure HTTP basic authorization: BasicAuth
              config.username = 'USERNAME'
              config.password = 'API_KEY'
            end

            api_instance = ClickSendClient::MasterEmailTemplatesApi.new

            template_id = 56 # Integer | Email template id

            begin
              # Get specific master email template
              result = api_instance.master_email_template_get(template_id)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling MasterEmailTemplatesApi->master_email_template_get: #{e.response_body}"
            end
        - lang: Python
          source: >-
            from __future__ import print_function

            import clicksend_client

            from clicksend_client.rest import ApiException


            # Configure HTTP basic authorization: BasicAuth

            configuration = clicksend_client.Configuration()

            configuration.username = 'USERNAME'

            configuration.password = 'API_KEY'


            # create an instance of the API class

            api_instance =
            clicksend_client.MasterEmailTemplatesApi(clicksend_client.ApiClient(configuration))

            template_id = 61 # int | Email template id


            try:
                # Get specific master email template
                api_response = api_instance.master_email_template_get(template_id)
                print(api_response)
            except ApiException as e:
                print("Exception when calling MasterEmailTemplatesApi->master_email_template_get: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::MasterEmailTemplatesApi;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


            my $api =
            WWW::ClickSendClient::MasterEmailTemplatesApi->new(username =>
            $username, password => $password);


            my $json_output = $api->master_email_template_get('template_id' =>
            '123');


            print $json_output;
        - lang: objc
          source: >-
            #import "CSMasterEmailTemplatesApi.h"


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

            [apiConfig setUsername:@"USERNAME"];

            [apiConfig setPassword:@"PASSWORD"];


            NSNumber *templateId = [[NSNumber alloc] initWithInt:1];


            CSMasterEmailTemplatesApi *masterEmailTemplatesApiInstance =
            [[CSMasterEmailTemplatesApi alloc] init];

            [masterEmailTemplatesApiInstance
            masterEmailTemplateGetWithTemplateId:templateId
            completionHandler:^(NSString *output, NSError *error) {
                if (error) {
                    NSLog(@"Error: %@", error);
                } else {
                    NSLog(@"%@", output);
                }
            }];
        - lang: swift
          source: >-
            import Alamofire


            if let authHeader = Request.authorizationHeader(user: "USERNAME",
            password: "PASSWORD") {
                ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
            }

            MasterEmailTemplatesAPI.masterEmailTemplateGet(templateId: 1) {
            (dataString, error) in
                guard let dataString = dataString else {
                    print(error!)
                    return
                }
                if let data = dataString.data(using: String.Encoding.utf8) {
                    do {
                        if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                            print(dictonary)
                        } else {
                            print("Cannot convert the String value to JSON")
                        }
                    } catch let error as NSError {
                        print(error)
                    }
                }
            }
  /v3/email/master-templates-categories:
    get:
      summary: View Template Categories
      operationId: view-template-categories
      description: >-
        _Get all master email template categories_


        Get all master email template categories


        ### Parameters


        | Parameter | In | Type | Required | Description |

        | --- | --- | --- | --- | --- |

        | page | query | integer(int32) | false | Page number |

        | limit | query | integer(int32) | false | Number of records per page |



        Refer to [Status Codes](/#status-codes) for definitions of HTTP status
        code responses.



        <div style="background-color: #FF6A4B; padding: 10px; border-radius:
        8px;">
          <span style="color: white;">This endpoint requires authentication,</span> 
          <a href="/#authentication" style="color: white; text-decoration: underline;">more info...</a>
        </div>
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/view-template-categories'
      x-codeSamples:
        - lang: curl
          source: |-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
            'https://rest.clicksend.com/v3/email/master-templates-categories'
        - lang: PHP
          source: >-
            <?php

            require_once(__DIR__ . '/vendor/autoload.php');


            // Configure HTTP basic authorization: BasicAuth

            $config = ClickSend\Configuration::getDefaultConfiguration()
                          ->setUsername('USERNAME')
                          ->setPassword('API_KEY');

            $apiInstance = new ClickSend\Api\MasterEmailTemplatesApi(new
            GuzzleHttp\Client(),$config);

            $page = 1; // int | Page number

            $limit = 10; // int | Number of records per page


            try {
                $result = $apiInstance->masterEmailTemplateCategoriesGet($page, $limit);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling MasterEmailTemplatesApi->masterEmailTemplateCategoriesGet: ', $e->getMessage(), PHP_EOL;
            }

            ?>
        - lang: C#
          source: >-
            using IO.ClickSend.ClickSend.Api;

            using IO.ClickSend.Client;

            using IO.ClickSend.ClickSend.Model;


            var configuration = new Configuration()

            {
                Username = USERNAME, 
                Password = API_KEY  
            };

            var masterEmailTemplatesApi = new
            MasterEmailTemplatesApi(configuration);

            var response =
            masterEmailTemplatesApi.MasterEmailTemplateCategoriesGet();
        - lang: Java
          source: |-
            package ClickSend;

            import ClickSend.Api.MasterEmailTemplatesApi;

            public class view_all_template_categories {
              public static void main(String[] args) {
                ApiClient defaultClient = new ApiClient();
                defaultClient.setUsername("USERNAME");
                defaultClient.setPassword("API_KEY");
                MasterEmailTemplatesApi apiInstance = new MasterEmailTemplatesApi(defaultClient);
                Integer page = 1; // Integer | Page number
                Integer limit = 10; // Integer | Number of records per page
                try {
                    String result = apiInstance.masterEmailTemplateCategoriesGet(page, limit);
                    System.out.println(result);
                } catch (ApiException e) {
                    System.err.println("Exception when calling MasterEmailTemplatesApi#masterEmailTemplateCategoriesGet");
                    e.printStackTrace();
                }
              }
            }
        - lang: Node.js
          source: >-
            var api = require('./api.js');


            var masterEmailTemplateApi = new
            api.MasterEmailTemplatesApi("USERNAME", "API_KEY");


            var page = 1;

            var limit = 10;


            masterEmailTemplateApi.masterEmailTemplateCategoriesGet(page,
            limit).then(function(response) {
              console.log(response.body);
            }).catch(function(err){
              console.error(err.body);
            });
        - lang: Ruby
          source: |-
            # load the gem
            require 'clicksend_client'
            require 'json'

            # setup authorization
            ClickSendClient.configure do |config|
              # Configure HTTP basic authorization: BasicAuth
              config.username = 'USERNAME'
              config.password = 'API_KEY'
            end

            api_instance = ClickSendClient::MasterEmailTemplatesApi.new

            opts = {
              page: 1,  # Integer | Page number
              limit: 10 # Integer | Number of records per page
            }

            begin
              # Get all master email template categories
              result = api_instance.master_email_template_categories_get(opts)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling MasterEmailTemplatesApi->master_email_template_categories_get: #{e.response_body}"
            end
        - lang: Python
          source: >-
            from __future__ import print_function

            import clicksend_client

            from clicksend_client.rest import ApiException


            # Configure HTTP basic authorization: BasicAuth

            configuration = clicksend_client.Configuration()

            configuration.username = 'USERNAME'

            configuration.password = 'API_KEY'


            # create an instance of the API class

            api_instance =
            clicksend_client.MasterEmailTemplatesApi(clicksend_client.ApiClient(configuration))

            page = 1 # int | Page number (optional) (default to 1)

            limit = 10 # int | Number of records per page (optional) (default to
            10)


            try:
                # Get all master email template categories
                api_response = api_instance.master_email_template_categories_get(page=page, limit=limit)
                print(api_response)
            except ApiException as e:
                print("Exception when calling MasterEmailTemplatesApi->master_email_template_categories_get: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::MasterEmailTemplatesApi;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


            my $api =
            WWW::ClickSendClient::MasterEmailTemplatesApi->new(username =>
            $username, password => $password);


            my $json_output = $api->master_email_template_categories_get('page'
            => '1','limit' => '1');


            print $json_output;
        - lang: objc
          source: >-
            #import "CSMasterEmailTemplatesApi.h"


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

            [apiConfig setUsername:@"USERNAME"];

            [apiConfig setPassword:@"PASSWORD"];


            NSNumber *categoryId = [[NSNumber alloc] initWithInt:1];

            NSNumber *page = [[NSNumber alloc] initWithInt:1];

            NSNumber *limit = [[NSNumber alloc] initWithInt:15];


            CSMasterEmailTemplatesApi *masterEmailTemplatesApiInstance =
            [[CSMasterEmailTemplatesApi alloc] init];

            [masterEmailTemplatesApiInstance
            masterEmailTemplatesInCategoryGetWithCategoryId:categoryId page:page
            limit:limit completionHandler:^(NSString *output, NSError *error) {
                if (error) {
                    NSLog(@"Error: %@", error);
                } else {
                    NSLog(@"%@", output);
                }
            }];
        - lang: swift
          source: >-
            import Alamofire


            if let authHeader = Request.authorizationHeader(user: "USERNAME",
            password: "PASSWORD") {
                ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
            }


            MasterEmailTemplatesAPI.masterEmailTemplatesInCategoryGet(categoryId:
            1, page: 15, limit: nil) { (dataString, error) in
                guard let dataString = dataString else {
                    print(error!)
                    return
                }
                if let data = dataString.data(using: String.Encoding.utf8) {
                    do {
                        if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                            print(dictonary)
                        } else {
                            print("Cannot convert the String value to JSON")
                        }
                    } catch let error as NSError {
                    print(error)
                    }
                }
            }
  /v3/email/master-templates-categories/{category_id}:
    get:
      summary: View Template Category
      operationId: view-template-category
      description: >-
        _Get specific master email template category_


        Get specific master email template category


        ### Parameters


        | Parameter | In | Type | Required | Description |

        | --- | --- | --- | --- | --- |

        | category_id | path | integer(int32) | true | Email category id |



        Refer to [Status Codes](/#status-codes) for definitions of HTTP status
        code responses.



        <div style="background-color: #FF6A4B; padding: 10px; border-radius:
        8px;">
          <span style="color: white;">This endpoint requires authentication,</span> 
          <a href="/#authentication" style="color: white; text-decoration: underline;">more info...</a>
        </div>
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
        - name: category_id
          in: path
          schema:
            type: string
          required: true
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/view-template-category'
      x-codeSamples:
        - lang: curl
          source: >-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
            'https://rest.clicksend.com/v3/email/master-templates-categories/{category_id}'
        - lang: PHP
          source: >-
            <?php

            require_once(__DIR__ . '/vendor/autoload.php');


            // Configure HTTP basic authorization: BasicAuth

            $config = ClickSend\Configuration::getDefaultConfiguration()
                          ->setUsername('USERNAME')
                          ->setPassword('API_KEY');

            $apiInstance = new ClickSend\Api\MasterEmailTemplatesApi(new
            GuzzleHttp\Client(),$config);

            $category_id = 4; // int | Email category id


            try {
                $result = $apiInstance->masterEmailTemplateCategoryGet($category_id);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling MasterEmailTemplatesApi->masterEmailTemplateCategoryGet: ', $e->getMessage(), PHP_EOL;
            }

            ?>
        - lang: C#
          source: >-
            using IO.ClickSend.ClickSend.Api;

            using IO.ClickSend.Client;

            using IO.ClickSend.ClickSend.Model;


            var configuration = new Configuration()

            {
                Username = USERNAME, 
                Password = API_KEY  
            };

            var masterEmailTemplatesApi = new
            MasterEmailTemplatesApi(configuration);

            var response =
            masterEmailTemplatesApi.MasterEmailTemplateCategoryGet(CATEGORY_ID);
        - lang: Java
          source: |
            package ClickSend;

            import ClickSend.Api.MasterEmailTemplatesApi;

            public class view_specific_template_category {
              public static void main(String[] args) {
                ApiClient defaultClient = new ApiClient();
                defaultClient.setUsername("USERNAME");
                defaultClient.setPassword("API_KEY");
                MasterEmailTemplatesApi apiInstance = new MasterEmailTemplatesApi(defaultClient);
                Integer categoryId = 2; // Integer | Email category id
                try {
                    String result = apiInstance.masterEmailTemplateCategoryGet(categoryId);
                    System.out.println(result);
                } catch (ApiException e) {
                    System.err.println("Exception when calling MasterEmailTemplatesApi#masterEmailTemplateCategoryGet");
                    e.printStackTrace();
                }
              }
            }
        - lang: Node.js
          source: >-
            var api = require('./api.js');


            var masterEmailTemplateApi = new
            api.MasterEmailTemplatesApi("USERNAME", "API_KEY");


            var categoryId = 2;


            masterEmailTemplateApi.masterEmailTemplateCategoryGet(categoryId).then(function(response)
            {
              console.log(response.body);
            }).catch(function(err){
              console.error(err.body);
            });
        - lang: Ruby
          source: |-
            # load the gem
            require 'clicksend_client'
            require 'json'

            # setup authorization
            ClickSendClient.configure do |config|
              # Configure HTTP basic authorization: BasicAuth
              config.username = 'USERNAME'
              config.password = 'API_KEY'
            end

            api_instance = ClickSendClient::MasterEmailTemplatesApi.new

            category_id = 56 # Integer | Email category id

            begin
              # Get specific master email template category
              result = api_instance.master_email_template_category_get(category_id)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling MasterEmailTemplatesApi->master_email_template_category_get: #{e.response_body}"
            end
        - lang: Python
          source: >-
            from __future__ import print_function

            import clicksend_client

            from clicksend_client.rest import ApiException


            # Configure HTTP basic authorization: BasicAuth

            configuration = clicksend_client.Configuration()

            configuration.username = 'USERNAME'

            configuration.password = 'API_KEY'


            # create an instance of the API class

            api_instance =
            clicksend_client.MasterEmailTemplatesApi(clicksend_client.ApiClient(configuration))

            category_id = 16 # int | Email category id


            try:
                # Get specific master email template category
                api_response = api_instance.master_email_template_category_get(category_id)
                print(api_response)
            except ApiException as e:
                print("Exception when calling MasterEmailTemplatesApi->master_email_template_category_get: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::MasterEmailTemplatesApi;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


            my $api =
            WWW::ClickSendClient::MasterEmailTemplatesApi->new(username =>
            $username, password => $password);


            my $json_output =
            $api->master_email_template_category_get('category_id' => '1');


            print $json_output;
        - lang: objc
          source: >-
            #import "CSMasterEmailTemplatesApi.h"


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

            [apiConfig setUsername:@"USERNAME"];

            [apiConfig setPassword:@"PASSWORD"];


            NSNumber *categoryId = [[NSNumber alloc] initWithInt:1];

            NSNumber *page = [[NSNumber alloc] initWithInt:1];

            NSNumber *limit = [[NSNumber alloc] initWithInt:15];


            CSMasterEmailTemplatesApi *masterEmailTemplatesApiInstance =
            [[CSMasterEmailTemplatesApi alloc] init];

            [masterEmailTemplatesApiInstance
            masterEmailTemplatesInCategoryGetWithCategoryId:categoryId page:page
            limit:limit completionHandler:^(NSString *output, NSError *error) {
                if (error) {
                    NSLog(@"Error: %@", error);
                } else {
                    NSLog(@"%@", output);
                }
            }];
        - lang: swift
          source: >-
            import Alamofire


            if let authHeader = Request.authorizationHeader(user: "USERNAME",
            password: "PASSWORD") {
                ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
            }


            MasterEmailTemplatesAPI.masterEmailTemplatesInCategoryGet(categoryId:
            1) { (dataString, error) in
                guard let dataString = dataString else {
                    print(error!)
                    return
                }
                if let data = dataString.data(using: String.Encoding.utf8) {
                    do {
                        if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                            print(dictonary)
                        } else {
                            print("Cannot convert the String value to JSON")
                        }
                    } catch let error as NSError {
                    print(error)
                    }
                }
            }
  /v3/email/master-templates-categories/{category_id}/master-templates:
    get:
      summary: View Templates in Category
      operationId: view-templates-in-category
      description: >-
        _Get all master email templates in a category_


        Get all master email templates in a category


        ### Parameters


        | Parameter | In | Type | Required | Description |

        | --- | --- | --- | --- | --- |

        | category_id | path | integer(int32) | true | Email category id |

        | page | query | integer(int32) | false | Page number |

        | limit | query | integer(int32) | false | Number of records per page |



        Refer to [Status Codes](/#status-codes) for definitions of HTTP status
        code responses.



        <div style="background-color: #FF6A4B; padding: 10px; border-radius:
        8px;">
          <span style="color: white;">This endpoint requires authentication,</span> 
          <a href="/#authentication" style="color: white; text-decoration: underline;">more info...</a>
        </div>
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
        - name: category_id
          in: path
          schema:
            type: string
          required: true
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/view-templates-in-category'
      x-codeSamples:
        - lang: curl
          source: >-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
            'https://rest.clicksend.com/v3/email/master-templates-categories/{category_id}/master-templates'
        - lang: PHP
          source: >-
            <?php

            require_once(__DIR__ . '/vendor/autoload.php');


            // Configure HTTP basic authorization: BasicAuth

            $config = ClickSend\Configuration::getDefaultConfiguration()
                          ->setUsername('USERNAME')
                          ->setPassword('API_KEY');

            $apiInstance = new ClickSend\Api\MasterEmailTemplatesApi(new
            GuzzleHttp\Client(),$config);

            $category_id = 4; // int | Email category id

            $page = 1; // int | Page number

            $limit = 10; // int | Number of records per page


            try {
                $result = $apiInstance->masterEmailTemplatesInCategoryGet($category_id, $page, $limit);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling MasterEmailTemplatesApi->masterEmailTemplatesInCategoryGet: ', $e->getMessage(), PHP_EOL;
            }

            ?>
        - lang: C#
          source: >-
            using IO.ClickSend.ClickSend.Api;

            using IO.ClickSend.Client;

            using IO.ClickSend.ClickSend.Model;


            var configuration = new Configuration()

            {
                Username = USERNAME, 
                Password = API_KEY  
            };

            var masterEmailTemplatesApi = new
            MasterEmailTemplatesApi(configuration);

            var response =
            masterEmailTemplatesApi.MasterEmailTemplatesInCategoryGet(CATEGORY_ID);
        - lang: Java
          source: |-
            package ClickSend;

            import ClickSend.Api.MasterEmailTemplatesApi;

            public class view_template_in_category {
              public static void main(String[] args) {
                ApiClient defaultClient = new ApiClient();
                defaultClient.setUsername("USERNAME");
                defaultClient.setPassword("API_KEY");
                MasterEmailTemplatesApi apiInstance = new MasterEmailTemplatesApi(defaultClient);
                Integer categoryId = 2; // Integer | Email category id
                Integer page = 1; // Integer | Page number
                Integer limit = 10; // Integer | Number of records per page
                try {
                    String result = apiInstance.masterEmailTemplatesInCategoryGet(categoryId, page, limit);
                    System.out.println(result);
                } catch (ApiException e) {
                    System.err.println("Exception when calling MasterEmailTemplatesApi#masterEmailTemplatesInCategoryGet");
                    e.printStackTrace();
                }
              }
            }
        - lang: Node.js
          source: >-
            var api = require('./api.js');


            var masterEmailTemplateApi = new
            api.MasterEmailTemplatesApi("USERNAME", "API_KEY");


            var categoryId = 2;

            var page = 1;

            var limit = 10;


            masterEmailTemplateApi.masterEmailTemplatesInCategoryGet(categoryId,
            page, limit).then(function(response) {
              console.log(response.body);
            }).catch(function(err){
              console.error(err.body);
            });
        - lang: Ruby
          source: |-
            # load the gem
            require 'clicksend_client'
            require 'json'

            # setup authorization
            ClickSendClient.configure do |config|
              # Configure HTTP basic authorization: BasicAuth
              config.username = 'USERNAME'
              config.password = 'API_KEY'
            end

            api_instance = ClickSendClient::MasterEmailTemplatesApi.new

            category_id = 4 # Integer | Email category id

            opts = {
              page: 1, # Integer | Page number
              limit: 10 # Integer | Number of records per page
            }

            begin
              # Get all master email templates in a category
              result = api_instance.master_email_templates_in_category_get(category_id, opts)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling MasterEmailTemplatesApi->master_email_templates_in_category_get: #{e.response_body}"
            end
        - lang: Python
          source: >-
            from __future__ import print_function

            import clicksend_client

            from clicksend_client.rest import ApiException


            # Configure HTTP basic authorization: BasicAuth

            configuration = clicksend_client.Configuration()

            configuration.username = 'USERNAME'

            configuration.password = 'API_KEY'


            # create an instance of the API class

            api_instance =
            clicksend_client.MasterEmailTemplatesApi(clicksend_client.ApiClient(configuration))

            category_id = 13 # int | Email category id

            page = 1 # int | Page number (optional) (default to 1)

            limit = 10 # int | Number of records per page (optional) (default to
            10)


            try:
                # Get all master email templates in a category
                api_response = api_instance.master_email_templates_in_category_get(category_id, page=page, limit=limit)
                print(api_response)
            except ApiException as e:
                print("Exception when calling MasterEmailTemplatesApi->master_email_templates_in_category_get: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::MasterEmailTemplatesApi;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


            my $api =
            WWW::ClickSendClient::MasterEmailTemplatesApi->new(username =>
            $username, password => $password);


            my $json_output =
            $api->master_email_templates_in_category_get('category_id' => '123',
            'page' => '1' ,'limit' => '10' );


            print $json_output;
        - lang: objc
          source: >-
            #import "CSMasterEmailTemplatesApi.h"


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

            [apiConfig setUsername:@"USERNAME"];

            [apiConfig setPassword:@"PASSWORD"];


            NSNumber *categoryId = [[NSNumber alloc] initWithInt:1];

            NSNumber *page = [[NSNumber alloc] initWithInt:1];

            NSNumber *limit = [[NSNumber alloc] initWithInt:15];


            CSMasterEmailTemplatesApi *masterEmailTemplatesApiInstance =
            [[CSMasterEmailTemplatesApi alloc] init];

            [masterEmailTemplatesApiInstance
            masterEmailTemplatesInCategoryGetWithCategoryId:categoryId page:page
            limit:limit completionHandler:^(NSString *output, NSError *error) {
                if (error) {
                    NSLog(@"Error: %@", error);
                } else {
                    NSLog(@"%@", output);
                }
            }];
        - lang: swift
          source: >-
            import Alamofire


            if let authHeader = Request.authorizationHeader(user: "USERNAME",
            password: "PASSWORD") {
                ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
            }

            MasterEmailTemplatesAPI.masterEmailTemplatesInCategoryGet(categoryId:
            1) { (dataString, error) in
                guard let dataString = dataString else {
                    print(error!)
                    return
                }
                if let data = dataString.data(using: String.Encoding.utf8) {
                    do {
                        if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                            print(dictonary)
                        } else {
                            print("Cannot convert the String value to JSON")
                        }
                    } catch let error as NSError {
                    print(error)
                    }
                }
            }
  /v3/email/templates:
    get:
      summary: View Email Templates
      operationId: view-email-templates
      description: >-
        _Get all user email templates_


        Get all user email templates


        ### Parameters


        | Parameter | In | Type | Required | Description |

        | --- | --- | --- | --- | --- |

        | page | query | integer(int32) | false | Page number |

        | limit | query | integer(int32) | false | Number of records per page |



        Refer to [Status Codes](/#status-codes) for definitions of HTTP status
        code responses.



        <div style="background-color: #FF6A4B; padding: 10px; border-radius:
        8px;">
          <span style="color: white;">This endpoint requires authentication,</span> 
          <a href="/#authentication" style="color: white; text-decoration: underline;">more info...</a>
        </div>
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/view-email-templates'
      x-codeSamples:
        - lang: curl
          source: |-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
            'https://rest.clicksend.com/v3/email/templates'
        - lang: PHP
          source: >-
            <?php

            require_once(__DIR__ . '/vendor/autoload.php');


            // Configure HTTP basic authorization: BasicAuth

            $config = ClickSend\Configuration::getDefaultConfiguration()
                          ->setUsername('USERNAME')
                          ->setPassword('API_KEY');

            $apiInstance = new ClickSend\Api\UserEmailTemplatesApi(new
            GuzzleHttp\Client(),$config);

            $page = 1; // int | Page number

            $limit = 10; // int | Number of records per page


            try {
                $result = $apiInstance->emailTemplatesGet($page, $limit);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling UserEmailTemplatesApi->emailTemplatesGet: ', $e->getMessage(), PHP_EOL;
            }

            ?>
        - lang: C#
          source: >-
            using IO.ClickSend.ClickSend.Api;

            using IO.ClickSend.Client;

            using IO.ClickSend.ClickSend.Model;


            var configuration = new Configuration()

            {
                Username = USERNAME, 
                Password = API_KEY  
            };

            var userEmailTemplatesApi = new
            UserEmailTemplatesApi(configuration);

            var response = userEmailTemplatesApi.EmailTemplatesGet();
        - lang: Java
          source: |
            package ClickSend;

            import ClickSend.Api.UserEmailTemplatesApi;

            public class view_all_email_template {
               public static void main(String[] args) {
                  ApiClient defaultClient = new ApiClient();
                  defaultClient.setUsername("USERNAME");
                  defaultClient.setPassword("API_KEY");
                  UserEmailTemplatesApi apiInstance = new UserEmailTemplatesApi(defaultClient);
                  Integer page = 1; // Integer | Page number
                  Integer limit = 10; // Integer | Number of records per page
                  try {
                      String result = apiInstance.emailTemplatesGet(page, limit);
                      System.out.println(result);
                  } catch (ApiException e) {
                      System.err.println("Exception when calling UserEmailTemplatesApi#emailTemplatesGet");
                      e.printStackTrace();
                  }
               }
            }
        - lang: Node.js
          source: >-
            var api = require('./api.js');


            var userEmailTemplateApi = new api.UserEmailTemplatesApi("USERNAME",
            "API_KEY");


            var page = 1;

            var limit = 10;


            userEmailTemplateApi.emailTemplatesGet(page,
            limit).then(function(response) {
              console.log(response.body);
            }).catch(function(err){
              console.error(err.body);
            });
        - lang: Ruby
          source: |-
            # load the gem
            require 'clicksend_client'
            require 'json'

            # setup authorization
            ClickSendClient.configure do |config|
              # Configure HTTP basic authorization: BasicAuth
              config.username = 'USERNAME'
              config.password = 'API_KEY'
            end

            api_instance = ClickSendClient::UserEmailTemplatesApi.new

            opts = {
              page: 1,  # Integer | Page number
              limit: 10 # Integer | Number of records per page
            }

            begin
              # Get all user email templates
              result = api_instance.email_templates_get(opts)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling UserEmailTemplatesApi->email_templates_get: #{e.response_body}"
            end
        - lang: Python
          source: >-
            from __future__ import print_function

            import clicksend_client

            from clicksend_client.rest import ApiException


            # Configure HTTP basic authorization: BasicAuth

            configuration = clicksend_client.Configuration()

            configuration.username = 'USERNAME'

            configuration.password = 'API_KEY'


            # create an instance of the API class

            api_instance =
            clicksend_client.UserEmailTemplatesApi(clicksend_client.ApiClient(configuration))

            page = 1 # int | Page number (optional) (default to 1)

            limit = 10 # int | Number of records per page (optional) (default to
            10)


            try:
                # Get all user email templates
                api_response = api_instance.email_templates_get(page=page, limit=limit)
                print(api_response)
            except ApiException as e:
                print("Exception when calling UserEmailTemplatesApi->email_templates_get: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::UserEmailTemplatesApi;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


            my $api = WWW::ClickSendClient::UserEmailTemplatesApi->new(username
            => $username, password => $password);


            my $json_output = $api->email_templates_get('page' => '1' ,'limit'
            => '10' );


            print $json_output;
        - lang: objc
          source: >-
            #import "CSUserEmailTemplatesApi.h"


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

            [apiConfig setUsername:@"USERNAME"];

            [apiConfig setPassword:@"PASSWORD"];


            NSNumber *page = [[NSNumber alloc] initWithInt:1];

            NSNumber *limit = [[NSNumber alloc] initWithInt:15];


            CSUserEmailTemplatesApi *userEmailTemplatesApiInstance =
            [[CSUserEmailTemplatesApi alloc] init];

            [userEmailTemplatesApiInstance emailTemplatesGetWithPage:page
            limit:limit completionHandler:^(NSString *output, NSError *error) {
                if (error) {
                    NSLog(@"Error: %@", error);
                } else {
                    NSLog(@"%@", output);
                }
            }];
        - lang: swift
          source: >-
            import Alamofire


            if let authHeader = Request.authorizationHeader(user: "USERNAME",
            password: "PASSWORD") {
                ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
            }

            UserEmailTemplatesAPI.emailTemplatesGet(page: 1, limit: 15) {
            (dataString, error) in
                guard let dataString = dataString else {
                    print(error!)
                    return
                }
                if let data = dataString.data(using: String.Encoding.utf8) {
                    do {
                        if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                            print(dictonary)
                        } else {
                            print("Cannot convert the String value to JSON")
                        }
                    } catch let error as NSError {
                        print(error)
                    }
                }
            }
    post:
      summary: Create Email Template
      operationId: create-email-template
      description: >-
        _Create email template_


        Create email template


        ### Properties


        | Name | Type | Required | Restrictions | Description |

        | --- | --- | --- | --- | --- |

        | template_name | string | true | none | The intended name for the new
        template. |

        | template_id_master | number | true | none | The ID of the master
        template you want to base on. |



        Refer to [Status Codes](/#status-codes) for definitions of HTTP status
        code responses.



        <div style="background-color: #FF6A4B; padding: 10px; border-radius:
        8px;">
          <span style="color: white;">This endpoint requires authentication,</span> 
          <a href="/#authentication" style="color: white; text-decoration: underline;">more info...</a>
        </div>
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                template_id_master:
                  type: integer
                template_name:
                  type: string
              example:
                template_id_master: 1
                template_name: bitpolypmus
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/create-email-template'
      x-codeSamples:
        - lang: curl
          source: |-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
                 --request POST \
                 --header "Content-Type: application/json" \
                 --data-binary "{
              \"template_name\": \"Minions\",
              \"template_id_master\": 57
            }" \
            'https://rest.clicksend.com/v3/email/templates'
        - lang: PHP
          source: >-
            <?php

            require_once(__DIR__ . '/vendor/autoload.php');


            // Configure HTTP basic authorization: BasicAuth

            $config = ClickSend\Configuration::getDefaultConfiguration()
                          ->setUsername('USERNAME')
                          ->setPassword('API_KEY');

            $apiInstance = new ClickSend\Api\UserEmailTemplatesApi(new
            GuzzleHttp\Client(),$config);

            // \ClickSend\Model\EmailTemplateNew | Email template model

            $email_template = new \ClickSend\Model\EmailTemplateNew(); 

            $email_template->setTemplateName("template");

            $email_template->setTemplateIdMaster(57);


            try {
                $result = $apiInstance->emailTemplatePost($email_template);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling UserEmailTemplatesApi->emailTemplatePost: ', $e->getMessage(), PHP_EOL;
            }

            ?>
        - lang: C#
          source: >-
            using IO.ClickSend.ClickSend.Api;

            using IO.ClickSend.Client;

            using IO.ClickSend.ClickSend.Model;


            var configuration = new Configuration()

            {
                Username = USERNAME, 
                Password = API_KEY  
            };

            var userEmailTemplatesApi = new
            UserEmailTemplatesApi(configuration);

            var response = userEmailTemplatesApi.EmailTemplatePost(new
            EmailTemplateNew( 
                templateName: "Template Name",
                templateIdMaster: TEMPLATE_MASTER_ID
            ));
        - lang: Java
          source: |-
            package ClickSend;

            import java.math.BigDecimal;
            import ClickSend.Api.UserEmailTemplatesApi;
            import ClickSend.Model.EmailTemplateNew;

            public class create_email_template {
               public static void main(String[] args) {
                  ApiClient defaultClient = new ApiClient();
                  defaultClient.setUsername("USERNAME");
                  defaultClient.setPassword("API_KEY");
                  UserEmailTemplatesApi apiInstance = new UserEmailTemplatesApi(defaultClient);
                  EmailTemplateNew emailTemplate = new EmailTemplateNew(); // EmailTemplateNew | Email template model
                  emailTemplate.templateName("java template");
                  emailTemplate.templateIdMaster(new BigDecimal(57));
                  try {
                      String result = apiInstance.emailTemplatePost(emailTemplate);
                      System.out.println(result);
                  } catch (ApiException e) {
                      System.err.println("Exception when calling UserEmailTemplatesApi#emailTemplatePost");
                      e.printStackTrace();
                  }
               }
            }
        - lang: Node.js
          source: >-
            var api = require('./api.js');


            var userEmailTemplateApi = new api.UserEmailTemplatesApi("USERNAME",
            "API_KEY");


            var emailTemplate = new api.EmailTemplateNew();


            emailTemplate.templateName = "templateName";

            emailTemplate.templateIdMaster = 56;


            userEmailTemplateApi.emailTemplatePost(emailTemplate).then(function(response)
            {
              console.log(response.body);
            }).catch(function(err){
              console.error(err.body);
            });
        - lang: Ruby
          source: |-
            # load the gem
            require 'clicksend_client'
            require 'json'

            # setup authorization
            ClickSendClient.configure do |config|
              # Configure HTTP basic authorization: BasicAuth
              config.username = 'USERNAME'
              config.password = 'API_KEY'
            end

            api_instance = ClickSendClient::UserEmailTemplatesApi.new

            # EmailTemplateNew | Email template model
            email_template = ClickSendClient::EmailTemplateNew.new(
              "template_name": "template_name",
              "template_id_master": 10115
            )

            begin
              # Create email template
              result = api_instance.email_template_post(email_template)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling UserEmailTemplatesApi->email_template_post: #{e.response_body}"
            end
        - lang: Python
          source: >-
            from __future__ import print_function

            import clicksend_client

            from clicksend_client.rest import ApiException


            # Configure HTTP basic authorization: BasicAuth

            configuration = clicksend_client.Configuration()

            configuration.username = 'USERNAME'

            configuration.password = 'API_KEY'


            # create an instance of the API class

            api_instance =
            clicksend_client.UserEmailTemplatesApi(clicksend_client.ApiClient(configuration))

            email_template = clicksend_client.EmailTemplateNew(
                              template_name='test_template',
                              template_id_master=57) # EmailTemplateNew | Email template model

            try:
                # Create email template
                api_response = api_instance.email_template_post(email_template)
                print(api_response)
            except ApiException as e:
                print("Exception when calling UserEmailTemplatesApi->email_template_post: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::UserEmailTemplatesApi;

            use WWW::ClickSendClient::Object::EmailTemplateNew;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


            my $api = WWW::ClickSendClient::UserEmailTemplatesApi->new(username
            => $username, password => $password);


            my %params = (
                'template_name'      => 'template_name',
                'template_id_master' => '1234'
            );


            my $email_template_obj =
            WWW::ClickSendClient::Object::EmailTemplateNew->new(%params);

            my $json_output = $api->email_template_post('email_template' =>
            $email_template_obj);


            print $json_output;
        - lang: objc
          source: >-
            #import "CSUserEmailTemplatesApi.h"


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

            [apiConfig setUsername:@"USERNAME"];

            [apiConfig setPassword:@"PASSWORD"];


            CSEmailTemplateNew *emailTemplateNew = [[CSEmailTemplateNew alloc]
            init];

            emailTemplateNew.templateName = @"string";

            emailTemplateNew.templateIdMaster = 0;

            CSUserEmailTemplatesApi *userEmailTemplatesApiInstance =
            [[CSUserEmailTemplatesApi alloc] init];

            [userEmailTemplatesApiInstance
            emailTemplatePostWithEmailTemplate:emailTemplateNew
            completionHandler:^(NSString *output, NSError *error) {
                if (error) {
                    NSLog(@"Error: %@", error);
                } else {
                    NSLog(@"%@", output);
                }
            }];
        - lang: swift
          source: >-
            import Alamofire


            if let authHeader = Request.authorizationHeader(user: "USERNAME",
            password: "PASSWORD") {
                ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
            }

            let emailTemplate = EmailTemplateNew(templateName: "String",
            templateIdMaster: 1);

            UserEmailTemplatesAPI.emailTemplatePost(emailTemplate:
            emailTemplate) { (dataString, error) in
                guard let dataString = dataString else {
                    print(error!)
                    return
                }
                if let data = dataString.data(using: String.Encoding.utf8) {
                    do {
                        if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                            print(dictonary)
                        } else {
                            print("Cannot convert the String value to JSON")
                        }
                    } catch let error as NSError {
                    print(error)
                    }
                }
            }
  /v3/email/templates/{template_id}:
    get:
      summary: View Email Template
      operationId: view-email-template
      description: >-
        _Get specific user email template_


        Get specific user email templates


        ### Parameters


        | Parameter | In | Type | Required | Description |

        | --- | --- | --- | --- | --- |

        | template_id | path | integer(int32) | true | Email template id |



        Refer to [Status Codes](/#status-codes) for definitions of HTTP status
        code responses.



        <div style="background-color: #FF6A4B; padding: 10px; border-radius:
        8px;">
          <span style="color: white;">This endpoint requires authentication,</span> 
          <a href="/#authentication" style="color: white; text-decoration: underline;">more info...</a>
        </div>
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
        - name: template_id
          in: path
          schema:
            type: string
          required: true
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/view-email-template'
      x-codeSamples:
        - lang: curl
          source: |-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
            'https://rest.clicksend.com/v3/email/templates/{template_id}'
        - lang: PHP
          source: >-
            <?php

            require_once(__DIR__ . '/vendor/autoload.php');


            // Configure HTTP basic authorization: BasicAuth

            $config = ClickSend\Configuration::getDefaultConfiguration()
                          ->setUsername('USERNAME')
                          ->setPassword('API_KEY');

            $apiInstance = new ClickSend\Api\UserEmailTemplatesApi(new
            GuzzleHttp\Client(),$config);

            $template_id = 4609; // int | Email template id


            try {
                $result = $apiInstance->emailTemplateGet($template_id);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling UserEmailTemplatesApi->emailTemplateGet: ', $e->getMessage(), PHP_EOL;
            }

            ?>
        - lang: C#
          source: >-
            using IO.ClickSend.ClickSend.Api;

            using IO.ClickSend.Client;

            using IO.ClickSend.ClickSend.Model;


            var configuration = new Configuration()

            {
                Username = USERNAME, 
                Password = API_KEY  
            };

            var userEmailTemplatesApi = new
            UserEmailTemplatesApi(configuration);

            var response = userEmailTemplatesApi.EmailTemplateGet(TEMPLATE_ID);
        - lang: Java
          source: |-
            package ClickSend;

            import ClickSend.Api.UserEmailTemplatesApi;

            public class view_specific_email_template {
               public static void main(String[] args) {
                  ApiClient defaultClient = new ApiClient();
                  defaultClient.setUsername("USERNAME");
                  defaultClient.setPassword("API_KEY");
                  UserEmailTemplatesApi apiInstance = new UserEmailTemplatesApi(defaultClient);
                  Integer templateId = 4227; // Integer | Email template id
                  try {
                      String result = apiInstance.emailTemplateGet(templateId);
                      System.out.println(result);
                  } catch (ApiException e) {
                      System.err.println("Exception when calling UserEmailTemplatesApi#emailTemplateGet");
                      e.printStackTrace();
                  }
               }
            }
        - lang: Node.js
          source: >-
            var api = require('./api.js');


            var userEmailTemplateApi = new api.UserEmailTemplatesApi("USERNAME",
            "API_KEY");


            var templateId = 4471;


            userEmailTemplateApi.emailTemplateGet(templateId).then(function(response)
            {
              console.log(response.body);
            }).catch(function(err){
              console.error(err.body);
            });
        - lang: Ruby
          source: |-
            # load the gem
            require 'clicksend_client'
            require 'json'

            # setup authorization
            ClickSendClient.configure do |config|
              # Configure HTTP basic authorization: BasicAuth
              config.username = 'USERNAME'
              config.password = 'API_KEY'
            end

            api_instance = ClickSendClient::UserEmailTemplatesApi.new

            template_id = 56 # Integer | Email template id

            begin
              # Get specific user email template
              result = api_instance.email_template_get(template_id)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling UserEmailTemplatesApi->email_template_get: #{e.response_body}"
            end
        - lang: Python
          source: >-
            from __future__ import print_function

            import clicksend_client

            from clicksend_client.rest import ApiException


            # Configure HTTP basic authorization: BasicAuth

            configuration = clicksend_client.Configuration()

            configuration.username = 'USERNAME'

            configuration.password = 'API_KEY'


            # create an instance of the API class

            api_instance =
            clicksend_client.UserEmailTemplatesApi(clicksend_client.ApiClient(configuration))

            template_id = 4085 # int | Email template id


            try:
                # Get specific user email template
                api_response = api_instance.email_template_get(template_id)
                print(api_response)
            except ApiException as e:
                print("Exception when calling UserEmailTemplatesApi->email_template_get: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::UserEmailTemplatesApi;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


            my $api = WWW::ClickSendClient::UserEmailTemplatesApi->new(username
            => $username, password => $password);


            my $json_output = $api->email_template_get('template_id' => '1234');


            print $json_output;
        - lang: objc
          source: >-
            #import "CSUserEmailTemplatesApi.h"


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

            [apiConfig setUsername:@"USERNAME"];

            [apiConfig setPassword:@"PASSWORD"];


            NSNumber *templateId = [[NSNumber alloc] initWithInt:1];


            CSUserEmailTemplatesApi *userEmailTemplatesApiInstance =
            [[CSUserEmailTemplatesApi alloc] init];

            [userEmailTemplatesApiInstance
            emailTemplateGetWithTemplateId:templateId
            completionHandler:^(NSString *output, NSError *error) {
                if (error) {
                    NSLog(@"Error: %@", error);
                } else {
                    NSLog(@"%@", output);
                }
            }];
        - lang: swift
          source: >-
            import Alamofire


            if let authHeader = Request.authorizationHeader(user: "USERNAME",
            password: "PASSWORD") {
                ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
            }

            UserEmailTemplatesAPI.emailTemplateGet(templateId: 1) { (dataString,
            error) in
                guard let dataString = dataString else {
                    print(error!)
                    return
                }
                if let data = dataString.data(using: String.Encoding.utf8) {
                    do {
                        if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                            print(dictonary)
                        } else {
                            print("Cannot convert the String value to JSON")
                        }
                    } catch let error as NSError {
                print(error)
                    }   
                }
            }
    put:
      summary: Update Email Template
      operationId: update-email-template
      description: >-
        _Update email template_


        Update email template


        ### Parameters


        | Parameter | In | Type | Required | Description |

        | --- | --- | --- | --- | --- |

        | template_id | path | integer(int32) | true | Email template id |


        ### Properties


        | Name | Type | Required | Restrictions | Description |

        | --- | --- | --- | --- | --- |

        | template_name | string | false | none | The intended name for the
        template. |

        | body | string | true | none | Your template body. |



        Refer to [Status Codes](/#status-codes) for definitions of HTTP status
        code responses.



        <div style="background-color: #FF6A4B; padding: 10px; border-radius:
        8px;">
          <span style="color: white;">This endpoint requires authentication,</span> 
          <a href="/#authentication" style="color: white; text-decoration: underline;">more info...</a>
        </div>
      requestBody:
        content:
          application/json:
            schema:
              type: object
              properties:
                body:
                  type: string
              example:
                body: Test
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
        - name: template_id
          in: path
          schema:
            type: string
          required: true
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/update-email-template'
      x-codeSamples:
        - lang: curl
          source: |-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
                 --request PUT \

                 --data-binary "    {
                    \"template_name\":\"Minions\",
                    \"body\":\"This is a sample content: Sc0KNWgSMG for this template.\"
                }" \
            'https://rest.clicksend.com/v3/email/templates/{template_id}'
        - lang: PHP
          source: >-
            <?php

            require_once(__DIR__ . '/vendor/autoload.php');


            // Configure HTTP basic authorization: BasicAuth

            $config = ClickSend\Configuration::getDefaultConfiguration()
                          ->setUsername('USERNAME')
                          ->setPassword('API_KEY');

            $apiInstance = new ClickSend\Api\UserEmailTemplatesApi(new
            GuzzleHttp\Client(),$config);

            $template_id = 4609; // int | Email template id

            // \ClickSend\Model\EmailTemplateUpdate | Email template model

            $email_template = new \ClickSend\Model\EmailTemplateUpdate(); 

            $email_template->setTemplateName("template");

            $email_template->setBody("template body");


            try {
                $result = $apiInstance->emailTemplatePut($template_id, $email_template);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling UserEmailTemplatesApi->emailTemplatePut: ', $e->getMessage(), PHP_EOL;
            }

            ?>
        - lang: C#
          source: >-
            using IO.ClickSend.ClickSend.Api;

            using IO.ClickSend.Client;

            using IO.ClickSend.ClickSend.Model;


            var configuration = new Configuration()

            {
                Username = USERNAME, 
                Password = API_KEY  
            };

            var userEmailTemplatesApi = new
            UserEmailTemplatesApi(configuration);

            var response = userEmailTemplatesApi.EmailTemplatePut(TEMPLATE_ID,
            new EmailTemplateUpdate(
                templateName: "New Name",
                body: "Body"
            ));
        - lang: Java
          source: |-
            package ClickSend;

            import ClickSend.Api.UserEmailTemplatesApi;
            import ClickSend.Model.EmailTemplateUpdate;

            public class update_email_template {
               public static void main(String[] args) {
                  ApiClient defaultClient = new ApiClient();
                  defaultClient.setUsername("USERNAME");
                  defaultClient.setPassword("API_KEY");
                  UserEmailTemplatesApi apiInstance = new UserEmailTemplatesApi(defaultClient);
                  Integer templateId = 4227; // Integer | Email template id
                  EmailTemplateUpdate emailTemplate = new EmailTemplateUpdate(); // EmailTemplateUpdate | Email template model
                  emailTemplate.templateName("java template");
                  emailTemplate.body("update template content");
                  try {
                      String result = apiInstance.emailTemplatePut(templateId, emailTemplate);
                      System.out.println(result);
                  } catch (ApiException e) {
                      System.err.println("Exception when calling UserEmailTemplatesApi#emailTemplatePut");
                      e.printStackTrace();
                  }
               }
            }
        - lang: Node.js
          source: >-
            var api = require('./api.js');


            var userEmailTemplateApi = new api.UserEmailTemplatesApi("USERNAME",
            "API_KEY");


            var templateId = 4471;


            var emailTemplate = new api.EmailTemplateUpdate();


            emailTemplate.templateName = "templateName";

            emailTemplate.body = "body";


            userEmailTemplateApi.emailTemplatePut(templateId,
            emailTemplate).then(function(response) {
              console.log(response.body);
            }).catch(function(err){
              console.error(err.body);
            });
        - lang: Ruby
          source: |-
            # load the gem
            require 'clicksend_client'
            require 'json'

            # setup authorization
            ClickSendClient.configure do |config|
              # Configure HTTP basic authorization: BasicAuth
              config.username = 'USERNAME'
              config.password = 'API_KEY'
            end

            api_instance = ClickSendClient::UserEmailTemplatesApi.new

            template_id = 56 # Integer | Email template id

            # EmailTemplateUpdate | Email template model
            email_template = ClickSendClient::EmailTemplateUpdate.new(
              "template_name": "template_name",
              "body": "body"
            )

            begin
              # Update email template
              result = api_instance.email_template_put(template_id, email_template)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling UserEmailTemplatesApi->email_template_put: #{e.response_body}"
            end
        - lang: Python
          source: >-
            from __future__ import print_function

            import clicksend_client

            from clicksend_client.rest import ApiException


            # Configure HTTP basic authorization: BasicAuth

            configuration = clicksend_client.Configuration()

            configuration.username = 'USERNAME'

            configuration.password = 'API_KEY'


            # create an instance of the API class

            api_instance =
            clicksend_client.UserEmailTemplatesApi(clicksend_client.ApiClient(configuration))

            template_id = 4086 # int | Email template id

            # EmailTemplateUpdate | Email template model

            email_template = clicksend_client.EmailTemplateUpdate(
                              template_name='update_template',
                              body='hey template updated now') 

            try:
                # Update email template
                api_response = api_instance.email_template_put(template_id, email_template)
                print(api_response)
            except ApiException as e:
                print("Exception when calling UserEmailTemplatesApi->email_template_put: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::UserEmailTemplatesApi;

            use WWW::ClickSendClient::Object::EmailTemplateUpdate;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


            my $api = WWW::ClickSendClient::UserEmailTemplatesApi->new(username
            => $username, password => $password);


            my %params = (
                'template_name' => 'template_name',
                'body'          => 'body'
            );


            my $email_templ_update_obj =
            WWW::ClickSendClient::Object::EmailTemplateUpdate->new(%params);


            my $json_output = $api->email_template_put('template_id' => '1234'
            ,'email_template' => $email_templ_update_obj);


            print $json_output;
        - lang: objc
          source: >-
            #import "CSUserEmailTemplatesApi.h"


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

            [apiConfig setUsername:@"USERNAME"];

            [apiConfig setPassword:@"PASSWORD"];


            CSEmailTemplateNew *emailTemplateNew = [[CSEmailTemplateNew alloc]
            init];

            emailTemplateNew.templateName = @"string";

            emailTemplateNew.templateIdMaster =0;

            CSUserEmailTemplatesApi *userEmailTemplatesApiInstance =
            [[CSUserEmailTemplatesApi alloc] init];

            [userEmailTemplatesApiInstance
            emailTemplatePostWithEmailTemplate:emailTemplateNew
            completionHandler:^(NSString *output, NSError *error) {
                if (error) {
                    NSLog(@"Error: %@", error);
                } else {
                    NSLog(@"%@", output);
                }
            }];
        - lang: swift
          source: >-
            import Alamofire


            if let authHeader = Request.authorizationHeader(user: "USERNAME",
            password: "PASSWORD") {
                ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
            }


            let emailTemplate = EmailTemplateNew(
                                        templateName: "templateName", 
                                        templateIdMaster: 1
                                )
            UserEmailTemplatesAPI.emailTemplatePost(emailTemplate:
            emailTemplate) { (dataString, error) in
                guard let dataString = dataString else {
                    print(error!)
                    return
                }
                if let data = dataString.data(using: String.Encoding.utf8) {
                    do {
                        if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                            print(dictonary)
                        } else {
                            print("Cannot convert the String value to JSON")
                        }
                    } catch let error as NSError {
                    print(error)
                    }
                }
            }
    delete:
      summary: Delete Email Template
      operationId: delete-email-template
      description: >-
        _Delete user email template_


        Delete user email template


        ### Parameters


        | Parameter | In | Type | Required | Description |

        | --- | --- | --- | --- | --- |

        | template_id | path | integer(int32) | true | Email template id |



        Refer to [Status Codes](/#status-codes) for definitions of HTTP status
        code responses.



        <div style="background-color: #FF6A4B; padding: 10px; border-radius:
        8px;">
          <span style="color: white;">This endpoint requires authentication,</span> 
          <a href="/#authentication" style="color: white; text-decoration: underline;">more info...</a>
        </div>
      security:
        - basicAuth: []
      parameters:
        - name: Content-Type
          in: header
          schema:
            type: string
          example: application/json
        - name: template_id
          in: path
          schema:
            type: string
          required: true
      responses:
        '200':
          description: Successful response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/delete-email-template'
      x-codeSamples:
        - lang: curl
          source: |-
            curl --include \
                 --header "Authorization: Basic YXBpLXVzZXJuYW1lOmFwaS1wYXNzd29yZA=="  \
                 --request DELETE \
            'https://rest.clicksend.com/v3/email/templates/{template_id}'
        - lang: PHP
          source: >-
            <?php

            require_once(__DIR__ . '/vendor/autoload.php');


            // Configure HTTP basic authorization: BasicAuth

            $config = ClickSend\Configuration::getDefaultConfiguration()
                          ->setUsername('USERNAME')
                          ->setPassword('API_KEY');

            $apiInstance = new ClickSend\Api\UserEmailTemplatesApi(new
            GuzzleHttp\Client(),$config);

            $template_id = 4609; // int | Email template id


            try {
                $result = $apiInstance->emailTemplateDelete($template_id);
                print_r($result);
            } catch (Exception $e) {
                echo 'Exception when calling UserEmailTemplatesApi->emailTemplateDelete: ', $e->getMessage(), PHP_EOL;
            }

            ?>
        - lang: C#
          source: >-
            using IO.ClickSend.ClickSend.Api;

            using IO.ClickSend.Client;

            using IO.ClickSend.ClickSend.Model;


            var configuration = new Configuration()

            {
                Username = USERNAME, 
                Password = API_KEY  
            };

            var userEmailTemplatesApi = new
            UserEmailTemplatesApi(configuration);

            var response =
            userEmailTemplatesApi.EmailTemplateDelete(TEMPLATE_ID);
        - lang: Java
          source: |
            package ClickSend;

            import ClickSend.Api.UserEmailTemplatesApi;

            public class delete_email_template {
               public static void main(String[] args) {
                  ApiClient defaultClient = new ApiClient();
                  defaultClient.setUsername("USERNAME");
                  defaultClient.setPassword("API_KEY");
                  UserEmailTemplatesApi apiInstance = new UserEmailTemplatesApi(defaultClient);
                  Integer templateId = 4259; // Integer | Email template id
                  try {
                      String result = apiInstance.emailTemplateDelete(templateId);
                      System.out.println(result);
                  } catch (ApiException e) {
                      System.err.println("Exception when calling UserEmailTemplatesApi#emailTemplateDelete");
                      e.printStackTrace();
                  }
               }
            }
        - lang: Node.js
          source: >-
            var api = require('./api.js');


            var userEmailTemplateApi = new api.UserEmailTemplatesApi("USERNAME",
            "API_KEY");


            var templateId = 4471;


            userEmailTemplateApi.emailTemplateDelete(templateId).then(function(response)
            {
              console.log(response.body);
            }).catch(function(err){
              console.error(err.body);
            });
        - lang: Ruby
          source: |-
            # load the gem
            require 'clicksend_client'
            require 'json'

            # setup authorization
            ClickSendClient.configure do |config|
              # Configure HTTP basic authorization: BasicAuth
              config.username = 'USERNAME'
              config.password = 'API_KEY'
            end

            api_instance = ClickSendClient::UserEmailTemplatesApi.new

            template_id = 56 # Integer | Email template id

            begin
              # Delete user email template
              result = api_instance.email_template_delete(template_id)
              p JSON.parse(result)
            rescue ClickSendClient::ApiError => e
              puts "Exception when calling UserEmailTemplatesApi->email_template_delete: #{e.response_body}"
            end
        - lang: Python
          source: >-
            from __future__ import print_function

            import clicksend_client

            from clicksend_client.rest import ApiException


            # Configure HTTP basic authorization: BasicAuth

            configuration = clicksend_client.Configuration()

            configuration.username = 'USERNAME'

            configuration.password = 'API_KEY'


            # create an instance of the API class

            api_instance =
            clicksend_client.UserEmailTemplatesApi(clicksend_client.ApiClient(configuration))

            template_id = 4085 # int | Email template id


            try:
                # Delete user email template
                api_response = api_instance.email_template_delete(template_id)
                print(api_response)
            except ApiException as e:
                print("Exception when calling UserEmailTemplatesApi->email_template_delete: %s\n" % e)
        - lang: perl
          source: >-
            use WWW::ClickSendClient::UserEmailTemplatesApi;


            my $username = 'YOUR_API_USER_NAME';

            my $password = 'YOUR_API_PASSWORD';


            my $api = WWW::ClickSendClient::UserEmailTemplatesApi->new(username
            => $username, password => $password);


            my $json_output = $api->email_template_delete('template_id' =>
            '1234');


            print $json_output;
        - lang: objc
          source: >-
            #import "CSUserEmailTemplatesApi.h"


            CSDefaultConfiguration *apiConfig = [CSDefaultConfiguration
            sharedConfig];

            [apiConfig setUsername:@"USERNAME"];

            [apiConfig setPassword:@"PASSWORD"];


            NSNumber *templateId = [[NSNumber alloc] initWithInt:1];


            CSUserEmailTemplatesApi *userEmailTemplatesApiInstance =
            [[CSUserEmailTemplatesApi alloc] init];

            [userEmailTemplatesApiInstance
            emailTemplateDeleteWithTemplateId:templateId
            completionHandler:^(NSString *output, NSError *error) {
                if (error) {
                    NSLog(@"Error: %@", error);
                } else {
                    NSLog(@"%@", output);
                }
            }];
        - lang: swift
          source: >-
            import Alamofire


            if let authHeader = Request.authorizationHeader(user: "USERNAME",
            password: "PASSWORD") {
                ClickSendClientAPI.customHeaders = [authHeader.key : authHeader.value]
            }


            UserEmailTemplatesAPI.emailTemplateDelete(templateId: 1) {
            (dataString, error) in
                guard let dataString = dataString else {
                    print(error!)
                    return
                }
                if let data = dataString.data(using: String.Encoding.utf8) {
                    do {
                        if let dictonary = try (JSONSerialization.jsonObject(with: data, options: []) as? NSDictionary) {
                            print(dictonary)
                        } else {
                            print("Cannot convert the String value to JSON")
                        }
                    } catch let error as NSError {
                        print(error)
                    }
                }
            }
