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

# list campaigns

> Retrieves list of campaigns.




## OpenAPI

````yaml /marketONE/MarketONEAPIs.yaml get /slmgw/v1/campaigns
openapi: 3.0.1
info:
  title: MarketONE APIs
  description: >
    The MarketONE OpenAPIs provide a quick and easy way to access MarketONE
    features and your data. These APIs let Resellers (Service Providers) and
    Merchants work together to resell products and handle billing on a single
    platform.


    With an API key, you can authenticate and perform various tasks, like
    accessing and managing data. You can use an HTTP client in any programming
    language to send HTTP requests to MarketONE to create, edit, or delete data.
    The data you work with, like subscriptions or entitlements, are called
    resources, and each resource has its own endpoint (URL).


    The MarketONE OpenAPIs use built-in HTTP features, like HTTP authentication
    and HTTP verbs, which are easy for standard HTTP clients to understand. They
    also use HTTP response codes to indicate errors. All responses, including
    errors, are in JSON format, but our API libraries convert them into objects
    that are specific to the programming language you're using. 


    You can also download the MarketONE OpenAPIs in a YAML file, which is easy
    to read and manage.


    For more information about the MarketONE OpenAPIs, see the [API Reference
    Guide for Merchants](https://docs.saas.amdocs.com/bundle/b_partnerAPIGuide/)
    and the [API Reference Guide for Resellers (Service
    Providers)](https://docs.saas.amdocs.com/bundle/b_aggregatorAPIGuide).


    ## Other MarketONE APIs


    Other MarketONE APIs, such as the [Reseller (CSP) Adapter
    OpenAPIs](https://docs.saas.amdocs.com/bundle/MarketONECSPAdapter/page/index.html),
    the [Merchant (OTT) Service
    Callbacks](https://docs.saas.amdocs.com/bundle/MarketONEOTTServiceCallbacks/page/index.html),
    and the [Commerce Gateway
    OpenAPIs](https://docs.saas.amdocs.com/bundle/Amdocs_Media-Commerce-Gateway-Latest-resolved/page/index.html),
    are available to provide additional services for specific organizations.


    # Environments


    MarketONE provides two distinct environments for testing and production:

    - **Prodtest environment**: this is a pre-production environment allowing
    you to test your application with test data. Use server
    <https://int-prodtest.m1amdocs.io/>.

    - **Production environment**: this is the live environment for the
    real-world implementation of  data. Use server <https://int.m1amdocs.com/>.


    # HTTP Verbs


    The MarketONE OpenAPIs support the following HTTP verbs:

    - **GET**: Retrieve resources (as a list or single record fetch).

    - **POST**:  Create new resources or update existing ones (overloading
    during create/update is permitted where specified).

    - **PUT**: Create a new resource or replace a resource with the request
    payload.

    - **DELETE**: Remove ownership or hierarchical association between certain
    resources.


    #  Example

     ## Request Example

     ```
    POST /v1/entitlement 

    Content-Type: application/json

    {
      "account": {
        "id": "2922fbf1-1dc4-2293-9d0e-c9a46630ad6e"
      },
      "subscriptionId": "ef1917b8-4a06-4595-9998-718799a33ed6",
      "productCodes": [
        "Basic_Addon"
      ],
      "metadata": {
        "email": "j.smith@email.com"
      }
    }

    ```

      ## Response Example

    ```

    Response: 200 OK

    Content-Type: application/json

    [
      {
        "partnerSubscriptionId": "80e08955-b0e9-4ba6-b882-b24230bfc703",
        "account": {
          "id": "0006fbf1-1ac4-4793-9d0e-c0a0080ad6e",
          "partnerCustomerId": "1bbbb3a5-0f05-4009-b4ae-b01f7eba7g"
        },
       "subscriptionId": "ef1417b8-4a06-7775-8518-718714a33ed2",
        "externalPartnerSubscriptionId": "7d50531-31eb-45f9-91ce-6355250f5501",
        "partnerCode": "PRTNR",
        "productCode": "Basic_Addon",
        "createdDate": "2024-05-04T17:38:10.889",
        "updatedDate": "2024-05-04T17:38:11.160",
        "startServiceDate": "2024-05-04T17:38:10.889",
        "serviceStatus": "PROVISION-COMPLETE"
      }
    ]

    ```


    # Status Codes


    MarketONE uses the following HTTP response codes to indicate the success or
    failure of an API request.


    | Code | Status | Description |

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

    | **200** | OK | Everything worked as expected. |

    | **201** | OK | Everything worked as expected. |

    | **400** | Bad Request | The request was unacceptable, often due to missing
    a required parameter. Other possibilities include: <ul><li>A parameter
    doesn't fit the data type</li><li>A parameter is outside the maximum or
    minimum boundaries of what can be accepted.</li> |

    | **401** | Unauthorized | Couldn’t authenticate your request. This could be
    due to a wrong or invalid API key. |

    | **403** | Forbidden | Authentication failed. Check your username and
    password. |

    | **404** | Not Found | The requested resource doesn’t exist. |

    | **409** | Conflict | |

    | **429** | Too Many Requests | Too many requests were made to the API too
    quickly. |

    | **500** | Internal Server Error  | |

    | **501** | Not Implemented | |

    | **503** | Service Unavailable | We’re temporarily offline for maintenance.
    Please try again later. |


    # Authentication


    API keys are required to make requests to the MarketONE OpenAPIs. In Partner
    Ecosystem Management, Resellers (Service Providers) can conveniently
    [generate an API
    key](https://docs.saas.amdocs.com/bundle/b_userGuideForResellers/page/topics/apiKeysAggregatorManage_t.html).
    Merchants can also [generate an API key for each Reseller (Service Provider)
    partnership](https://docs.saas.amdocs.com/bundle/b_userGuideForMerchants/page/topics/apiKeysManage_t.html)
    in Partner Ecosystem Management. After you authenticate with your API
    key(s), you can access resources through the MarketONE OpenAPIs.


    Each API key is a JSON Web Token (JWT) that doesn't expire. For every API
    call you make to the MarketONE OpenAPIs, the API key must be included in the
    header (`X-API-KEY`) of the call to ensure trusted communication. All
    communication is HTTP(s) based and supports SSL/TLS encryption.


    # Errors


    All error responses will return an error object.


    # Attributes


    | Name | Type | Required/Optional | Description |

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

    | **code** | string | required | The error type, such as
    "authentication-required" (401) or "not-found" (404). |

    | **message** | string | required | A human-readable message providing more
    detailed information about the error. |

    | **validationErrors** | object | optional | An array of validation errors
    with **code** and **message** attributes provided. |
  license:
    name: Amdocs Inc.
    url: http://www.amdocs.com
  version: Released
servers:
  - url: https://int-prodtest.m1amdocs.io/
    description: Sandbox server (uses test data)
  - url: https://int.m1amdocs.com/
    description: Production server (uses live data)
security: []
paths:
  /slmgw/v1/campaigns:
    get:
      tags:
        - campaigns
        - marketplace
      summary: list campaigns
      description: |
        Retrieves list of campaigns.
      operationId: searchAllCampaigns
      parameters:
        - name: M1-Organization-Code
          in: header
          description: >-
            The aggregator organization code. Organization code must be provided
            either via HTTP header or query parameter. If both are provided,
            HTTP header will be used.
          required: false
          style: simple
          explode: false
          schema:
            maxLength: 16
            type: string
        - name: organizationCode
          in: query
          description: >-
            The aggregator organization code. Organization code must be provided
            either via HTTP header or query parameter. If both are provided,
            HTTP header will be used.
          required: false
          style: form
          explode: true
          schema:
            maxLength: 16
            type: string
        - name: limit
          in: query
          description: A limit on the number of objects to be returned, between 1 and 100.
          required: false
          style: form
          explode: true
          schema:
            minimum: 1
            type: integer
            format: int32
            default: 20
        - name: starting_after
          in: query
          description: >-
            A cursor for use in pagination. starting_after is an object **id**
            that defines your place in the list. For instance, if you make a
            list request and receive 100 objects, ending with obj_foo, your
            subsequent call can include starting_after=obj_foo in order to fetch
            the next page of the list.
          required: false
          style: form
          explode: true
          schema:
            type: string
        - name: ending_before
          in: query
          description: >-
            A cursor for use in pagination. ending_before is an object **id**
            that defines your place in the list. For instance, if you make a
            list request and receive 100 objects, starting with obj_bar, your
            subsequent call can include ending_before=obj_bar in order to fetch
            the previous page of the list.
          required: false
          style: form
          explode: true
          schema:
            type: string
        - name: state
          in: query
          required: false
          style: form
          explode: true
          schema:
            type: string
            enum:
              - Active
              - Canceled
              - Complete
              - Inactive
              - MatchAnyState
              - Pending
              - Undefined
      responses:
        '200':
          description: >-
            JSON A list array of Campaigns. Each entry in the array is a full
            CCampaigns object. If no more objects are available, the resulting
            array will be empty. This request should never throw an error.

            A list of Campaigns objects matching the query. Also:

            * "total_count": Integer count of the number of Campaigns objects in
            the returned list.

            * "url": The query string provided in the request

            * "next": The route (partial URL) to the next Campaigns object
            (string to select the “next”); included id should match that of the
            last object returned here

            * "previous": The route (partial URL) to the previous Campaigns
            object (string to select the “previous”); included id should match
            that of the first object returned here
          content:
            application/json:
              schema:
                type: array
                example: >-
                  { "object": "List", "data": [ { "object": "Campaign", "id":
                  "TestFromREST", "vid":
                  "30b7590565f5bfbaaa97073616895058f56a27c5", "name":
                  "TestFromREST", "description": "Campaign test from REST post",
                  "state": "Active", "offer_start_date":
                  "2021-01-16T00:00:00+00:00", "offer_end_date":
                  "2022-01-16T00:00:00+00:00", "type": "Promotion",
                  "percentage_discount": 2, "apply_discount_per_item": false,
                  "number_of_periods": 5, "promotion_code": null,
                  "stackability": "Stackable" }, { "object": "Campaign", "id":
                  "CampaignsTest", "vid":
                  "0d5ea80c7792156ec92364e30d18d19ab6b4032a", "name":
                  "SUMMER50", "description": "Campaign test from REST post",
                  "state": "Active", "offer_start_date":
                  "2021-01-17T08:00:00+00:00", "offer_end_date":
                  "2023-01-16T08:00:00+00:00", "type": "Coupon",
                  "percentage_discount": 50, "apply_discount_per_item": false,
                  "number_of_periods": 5, "max_redemptions": 1,
                  "coupon_code_quantity": 10, "coupon_code_prefix": "HOT",
                  "coupon_code_separator": "-",
                  "coupon_code_requires_activation": true,
                  "on_demand_codes_allowed": true, "stackability": "Stackable",
                  "total_code_marked_used": 0 }, { "object": "Campaign", "id":
                  "TestFromREST_NEW", "vid":
                  "60e15a876b4f44ca3f030007275163abd8c87cc2", "name":
                  "TestFromREST_NEW", "description": "Campaign test from REST
                  post", "state": "Active", "offer_start_date":
                  "2021-01-16T00:00:00+00:00", "offer_end_date":
                  "2023-01-16T00:00:00+00:00", "type": "Promotion",
                  "percentage_discount": 2, "apply_discount_per_item": false,
                  "number_of_periods": 5, "promotion_code": null,
                  "stackability": "Stackable" } ], "total_count": 3, "url":
                  "/campaigns", "next":
                  "/campaigns?starting_after=TestFromREST_NEW", "previous":
                  "/campaigns?ending_before=TestFromREST" }
                items:
                  $ref: '#/components/schemas/CancelFeePolicyList'
        '400':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal server error
      security: []
components:
  schemas:
    CancelFeePolicyList:
      type: object
      properties:
        object:
          type: string
          enum:
            - List
        data:
          type: array
          items:
            $ref: '#/components/schemas/CancelFeePolicy'
        total_count:
          type: integer
          description: Integer count of the number of items in the returned list.
        url:
          type: string
          description: The query string provided in the request
        next:
          type: string
          description: >-
            The route (partial URL) to the next CancelFeePolicy object (string
            to select the "next"); included id should match that of the last
            object returned here.
        previous:
          type: string
          description: >-
            The route (partial URL) to the previous CancelFeePolicy object
            (string to select the "previous"); included id should match that of
            the first object returned here.
      description: A list of cancel fee policies.
    Error:
      required:
        - code
      type: object
      properties:
        code:
          type: string
        message:
          type: string
      description: The object contains information about the error.
    CancelFeePolicy:
      type: object
      properties:
        object:
          type: string
          description: Value is “CancelFeePolicy”
          enum:
            - CancelFeePolicy
        name:
          type: string
          description: The name of the cancel fee policy
        description:
          type: string
          description: A description of the cancel fee policy

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.