### Example 200 OK Response Source: https://lk.mediascout.ru/webapi/documentation/index.html This is an example of a successful response (200 OK) after creating or retrieving a site. It includes the assigned ID. ```json { "name": "Тестовая площадка", "type": "Site", "url": "https://example.com", "isOwner": true, "id": "PLCqwqXBhLMk6eTsIQoUT48A" } ``` -------------------------------- ### Request and Response Examples Source: https://lk.mediascout.ru/webapi/documentation/index.html This section provides examples for request payloads and response bodies, including error responses. ```APIDOC ## Request Payload Example ### Description Example of a JSON payload for a request. ### Content Type application/json ### Payload ```json { "initialContracts": [ "string" ], "statisticsByPlatforms": [ { "erid": "2SDnjegvUsB", "platformUrl": "https://example.com", "type": "CPM", "startDatePlan": "2024-05-22", "startDateFact": "2024-05-22", "endDatePlan": "2024-05-22", "endDateFact": "2024-05-22", "initialContractId": "CTRl8rP7sBCU6KfyeCWdYBcw" } ] } ``` ## Response Samples ### Description Examples of response bodies, including success and error scenarios. #### Success Response (204 No Content) No content is returned on successful completion. #### Error Responses ##### 400 Bad Request ##### Response Schema: application/problem+json ```json { "type": "https://lk.mediascout.ru/ru/400", "title": "Ошибка валидации данных запроса", "status": 400, "detail": "This field is required", "instance": "/webapi/vN/method", "traceId": "ff4498a5f7d64fdab544453094d81ad6", "errors": { "Item": [ "Значение поля нарушает некоторые требования" ] } } ``` ##### 401 Unauthorized ##### Response Schema: application/problem+json ```json { "type": "string or null", "title": "string or null", "status": "integer or null", "detail": "string or null", "instance": "string or null" } ``` ##### 403 Forbidden ##### Response Schema: application/problem+json ```json { "type": "string or null", "title": "string or null", "status": "integer or null", "detail": "string or null", "instance": "string or null" } ``` ##### 500 Internal Server Error ##### Response Schema: application/problem+json ```json { "type": "string or null", "title": "string or null", "status": "integer or null", "detail": "string or null", "instance": "string or null" } ``` ``` -------------------------------- ### Request Payload Example (application/json) Source: https://lk.mediascout.ru/webapi/documentation/index.html Example JSON payload for creating or updating resources. Use this structure when sending data to the API. ```json { "ids": [ "string" ], "nativeCustomerIds": [ "string" ], "feedNativeCustomerId": "string", "status": "Creating" } ``` -------------------------------- ### Request Payload Example Source: https://lk.mediascout.ru/webapi/documentation/index.html This snippet shows an example of the request payload for the API. ```APIDOC ## Request Payload Example ### Description This is an example of a request payload that can be sent to the API. ### Request Example ```json { "initialContractsData": [ { "initialContractId": "CT7ae_PK9R0hCdAb-NfHH2fN", "amount": { "amountExcludingVat": 0.1, "vatRate": 0.1, "vat": 0.1, "amountIncludingVat": 0.1 }, "isSocial": true, "isSocialQuota": true } ], "statisticsByPlatforms": [ { "erid": "Pb3MmBtzsrbL19RgOqsipS1ANueaCUzJSdpiY5g", "platformUrl": "https://example.ru", "platformName": "test", "platformType": "Site", "platformOwnedByAgency": false, "type": "CPM", "impsPlan": 100, "impsFact": 100, "startDatePlan": "2022-12-01", "startDateFact": "2022-12-01", "endDatePlan": "2022-12-31", "endDateFact": "2022-12-31", "amount": { "amountExcludingVat": 0.1, "vatRate": 0.1, "vat": 0.1, "amountIncludingVat": 0.1 }, "price": 10, "initialContractId": "CT7ae_PK9R0hCdAb-NfHH2fN" } ] } ``` ``` -------------------------------- ### Invoice Response Example Source: https://lk.mediascout.ru/webapi/documentation/index.html This snippet shows an example of a successful invoice response from the API. ```APIDOC ## Response Example (200) ### Content Type application/json ### Body ```json { "id": "INUFNs1ibfg0erF1PNpTOAyg", "type": "Invoice", "status": "Creating", "services": { "amountExcludingVat": 0.1, "vatRate": 0.1, "vat": 0.1, "amountIncludingVat": 0.1 }, "commission": { "amountExcludingVat": 0.1, "vatRate": 0.1, "vat": 0.1, "amountIncludingVat": 0.1, "intermediaryReportNumber": "string", "intermediaryReportDate": "2019-08-24" }, "initialContractsCount": 12, "initialContractsAmount": 1000, "creativesCount": 50, "platformsCount": 500, "impsFactCount": 1500, "impsPlanCount": 1400, "impsAmountIncludingVat": 2000 } ``` ``` -------------------------------- ### Request Payload Example Source: https://lk.mediascout.ru/webapi/documentation/index.html Example JSON payload for creating a client, specifying legal form, identification numbers, and contact details. ```json { "legalForm": "JuridicalPerson", "inn": "1234567890", "name": "ООО \"Заря\"", "physicalPersonAddress": "string", "mobilePhone": "+79999999999", "epayNumber": "string", "regNumber": "string", "oksmNumber": "string", "createMode": "DirectClient" } ``` -------------------------------- ### Response Sample Source: https://lk.mediascout.ru/webapi/documentation/index.html Example of a successful response payload. ```APIDOC ## Response Sample (200 OK) Content type: application/json ```json [ { "finalContractId": "CT3at_SU7y3ECdCb-AfHV3sA", "mediationOrderContractId": "CT4ppHvjNpWEuSZXqJPq5XVQ", "mediationOrderContractIds": [ "string" ], "type": "Invoice", "number": "Тест", "date": "2022-12-31", "contractorRole": "Ra", "clientRole": "Rd", "services": { "amountExcludingVat": 0.1, "vatRate": 0.1, "vat": 0.1, "amountIncludingVat": 0.1 }, "commission": { "amountExcludingVat": 0.1, "vatRate": 0.1, "vat": 0.1, "amountIncludingVat": 0.1, "intermediaryReportNumber": "string", "intermediaryReportDate": "2019-08-24" }, "startDate": "2022-12-01", "endDate": "2022-12-31", "id": "INUFNs1ibfg0erF1PNpTOAyg", "status": "Creating", "erirValidationError": { "stage": "EntityHeader", "code": "I_82", "message": "В разаллокации присутствует более одного договора", "responseDt": "2019-08-24T14:15:22Z" } } ] ``` ``` -------------------------------- ### JSON Response Example (201 Created) Source: https://lk.mediascout.ru/webapi/documentation/index.html This is a sample JSON response for a successful creation (201). It contains the identifier for the created resource. ```json { "id": "INUFNs1ibfg0erF1PNpTOAyg" } ``` -------------------------------- ### Request Payload Example Source: https://lk.mediascout.ru/webapi/documentation/index.html This is an example of a JSON payload for a request. It includes initial and final contract IDs. ```json { "initialContractId": "CLhOO5UT6sIk-fIRu-QEsEuQ", "finalContractId": "CT0N4ufC76TEu1xBEIwJ3CaA" } ``` -------------------------------- ### JSON Request Payload Example Source: https://lk.mediascout.ru/webapi/documentation/index.html This snippet shows an example of a JSON payload for submitting initial contracts and platform statistics. Ensure all required fields are correctly formatted. ```json { "initialContracts": [ "string" ], "statisticsByPlatforms": [ { "erid": "2SDnjegvUsB", "platformUrl": "https://example.com", "type": "CPM", "startDatePlan": "2024-05-22", "startDateFact": "2024-05-22", "endDatePlan": "2024-05-22", "endDateFact": "2024-05-22", "initialContractId": "CTRl8rP7sBCU6KfyeCWdYBcw" } ] } ``` -------------------------------- ### Response Payload Example Source: https://lk.mediascout.ru/webapi/documentation/index.html This is an example of a successful JSON response payload. It includes details of a created service agreement and potential error information. ```json { "number": "Тест", "date": "2023-04-01", "expirationDate": "2023-05-01", "amount": 100, "isAgentActingForPublisher": true, "isChargePaidByAgent": false, "subjectType": "Distribution", "actionType": "Contracting", "parentMainContractId": "CT0N4ufC76TEu1xBEIwJ3CaA", "id": "CT0N4ufC76TEu1xBEIwJ3CaA", "type": "ServiceAgreement", "status": "Created", "clientId": "CLhOO5UT6sIk-fIRu-QEsEuQ", "partnerId": "CLhOO5UT6sIk-fIRu-QEsEuQ", "contractorId": "CLhOO5UT6sIk-fIRu-QEsEuQ", "contractorInn": "7722643959", "contractorName": "ООО \"Ромашка\"", "cid": "763acd99-687b-46cd-8f40-45eced77413c", "erirValidationError": { "stage": "EntityHeader", "code": "I_82", "message": "В разаллокации присутствует более одного договора", "responseDt": "2019-08-24T14:15:22Z" } } ``` -------------------------------- ### Request Samples Source: https://lk.mediascout.ru/webapi/documentation/index.html This section provides an example of a request payload for the API. ```APIDOC ## Request Samples ### Request Body #### Payload **Content type:** application/json ```json { "initialContractsData": [ { "initialContractId": "CT7ae_PK9R0hCdAb-NfHH2fN", "amount": { "amountExcludingVat": 0.1, "vatRate": 0.1, "vat": 0.1, "amountIncludingVat": 0.1 }, "isSocial": true, "isSocialQuota": true } ], "statisticsByPlatforms": [ { "erid": "Pb3MmBtzsrbL19RgOqsipS1ANueaCUzJSdpiY5g", "platformUrl": "https://example.ru", "platformName": "test", "platformType": "Site", "platformOwnedByAgency": false, "type": "CPM", "impsPlan": 100, "impsFact": 100, "startDatePlan": "2022-12-01", "startDateFact": "2022-12-01", "endDatePlan": "2022-12-31", "endDateFact": "2022-12-31", "amount": { "amountExcludingVat": 0.1, "vatRate": 0.1, "vat": 0.1, "amountIncludingVat": 0.1 }, "price": 10, "initialContractId": "CT7ae_PK9R0hCdAb-NfHH2fN" } ] } ``` ``` -------------------------------- ### Sample JSON Response for Entity Creation Source: https://lk.mediascout.ru/webapi/documentation/index.html Provides an example of a successful JSON response when an entity is created, including its details and potential validation errors. ```json [ { "legalForm": "JuridicalPerson", "inn": "1234567890", "name": "ООО \"Заря\"", "physicalPersonAddress": "string", "mobilePhone": "+79999999999", "epayNumber": "string", "regNumber": "string", "oksmNumber": "string", "id": "CLfFpx6Ee4qkawO6JwEDJqFQ", "status": "Created", "erirValidationError": { "stage": "EntityHeader", "code": "I_82", "message": "В разаллокации присутствует более одного договора", "responseDt": "2019-08-24T14:15:22Z" } } ] ``` -------------------------------- ### Successful Response Example (200 OK) Source: https://lk.mediascout.ru/webapi/documentation/index.html Provides a sample JSON payload for a successful API response, illustrating the structure of returned data. ```APIDOC ## Successful Response Example (200 OK) ### Description This section provides an example of a successful response payload when the request is processed without errors. The response is in JSON format. ### Content Type application/json ### Response Body Example ```json [ { "creativeGroupId": "string", "finalContractId": "string", "initialContractId": "string", "cobrandingContractIds": [ "string" ], "isSelfPromotion": true, "creativeGroupName": "string", "startDate": "2019-08-24", "endDate": "2019-08-24", "type": "CPM", "form": "Banner", "isNative": true, "isSocial": true, "isSocialQuota": true, "isCobranding": true, "kktuCodes": [ "string" ], "targetAudienceParams": [ { "type": "Geo", "values": [ "string" ] } ], "description": "string", "creativeGroupNumber": 0 } ] ``` ``` -------------------------------- ### JSON Request Payload Example Source: https://lk.mediascout.ru/webapi/documentation/index.html Example of a JSON payload for a request, including contract details, dates, and financial information. Ensure all required fields are populated. ```json { "finalContractId": "CT3at_SU7y3ECdCb-AfHV3sA", "mediationOrderContractId": "CT4ppHvjNpWEuSZXqJPq5XVQ", "mediationOrderContractIds": [ "string" ], "type": "Invoice", "number": "Тест", "date": "2022-12-31", "contractorRole": "Ra", "clientRole": "Rd", "services": { "amountExcludingVat": 0.1, "vatRate": 0.1, "vat": 0.1, "amountIncludingVat": 0.1 }, "commission": { "amountExcludingVat": 0.1, "vatRate": 0.1, "vat": 0.1, "amountIncludingVat": 0.1, "intermediaryReportNumber": "string", "intermediaryReportDate": "2019-08-24" }, "startDate": "2022-12-01", "endDate": "2022-12-31" } ``` -------------------------------- ### Response Payload Example (Success with Error Details) Source: https://lk.mediascout.ru/webapi/documentation/index.html Example JSON response for a successful creation (200/201) that includes specific validation errors from the ERIR system. ```json { "legalForm": "JuridicalPerson", "inn": "1234567890", "name": "ООО \"Заря\"", "physicalPersonAddress": "string", "mobilePhone": "+79999999999", "epayNumber": "string", "regNumber": "string", "oksmNumber": "string", "id": "CLfFpx6Ee4qkawO6JwEDJqFQ", "status": "Created", "erirValidationError": { "stage": "EntityHeader", "code": "I_82", "message": "В разаллокации присутствует более одного договора", "responseDt": "2019-08-24T14:15:22Z" } } ``` -------------------------------- ### Request Payload Example Source: https://lk.mediascout.ru/webapi/documentation/index.html This is an example of the JSON payload structure for a request to the MediaScout API. It includes details about feed information, customer IDs, and media/text data. ```json { "feedId": "string", "feedNativeCustomerId": "string", "feedName": "string", "feedElements": [ { "nativeCustomerId": "string", "description": "string", "advertiserUrls": [ "string" ], "mediaData": [ { "fileName": "file.txt", "fileContentBase64": "string", "srcUrl": "https://example.com", "description": "Описание", "isArchive": true } ], "textData": [ { "textData": "Некий текст" } ] } ] } ``` -------------------------------- ### Response Samples Source: https://lk.mediascout.ru/webapi/documentation/index.html Example response for a successful request (200) and error responses. ```APIDOC ## Response Samples ### Success Response (200) **Content Type:** `application/json` ```json [ { "number": "Тест", "date": "2023-04-01", "expirationDate": "2023-05-01", "amount": 100, "isAgentActingForPublisher": true, "isChargePaidByAgent": false, "subjectType": "Distribution", "actionType": "Contracting", "parentMainContractId": "CT0N4ufC76TEu1xBEIwJ3CaA", "id": "CT0N4ufC76TEu1xBEIwJ3CaA", "type": "ServiceAgreement", "status": "Created", "clientId": "CLhOO5UT6sIk-fIRu-QEsEuQ", "partnerId": "CLhOO5UT6sIk-fIRu-QEsEuQ", "contractorId": "CLhOO5UT6sIk-fIRu-QEsEuQ", "contractorInn": "7722643959", "contractorName": "ООО \"Ромашка\"", "cid": "763acd99-687b-46cd-8f40-45eced77413c", "erirValidationError": { "stage": "EntityHeader", "code": "I_82", "message": "В разаллокации присутствует более одного договора", "responseDt": "2019-08-24T14:15:22Z" } } ] ``` ### Error Responses - **400**: Bad Request - **401**: Unauthorized - **403**: Forbidden - **500**: Internal Server Error ``` -------------------------------- ### Example JSON Response for Final Contract Source: https://lk.mediascout.ru/webapi/documentation/index.html This is an example of a JSON response when retrieving information about a final contract. It includes identifiers for the contract, contractor, and client, along with other contract details. ```json { "finalContractId": "CT0N4ufC76TEu1xBEIwJ3CaA", "contractorId": "CLhOO5UT6sIk-fIRu-QEsEuQ", "clientId": "CLhOO5UT6sIk-fIRu-QEsEuQ", "number": "string", "id": "5951f043-55c3-4456-8c17-3e0d4793dae1", "cid": "5951f043-55c3-4456-8c17-3e0d4793dae1" } ``` -------------------------------- ### Response Payload Example (200/201) Source: https://lk.mediascout.ru/webapi/documentation/index.html This is an example of a successful JSON response payload, typically for 200 OK or 201 Created status codes. It includes the fields from the request, plus an 'id' and 'status'. ```json { "number": "Тест", "date": "2023-04-01", "expirationDate": "2023-05-01", "amount": 100, "isAgentActingForPublisher": true, "isChargePaidByAgent": false, "subjectType": "Distribution", "actionType": "Contracting", "parentMainContractId": "CT0N4ufC76TEu1xBEIwJ3CaA", "id": "CT0N4ufC76TEu1xBEIwJ3CaA", "type": "ServiceAgreement", "status": "Created", "contractorId": "CLhOO5UT6sIk-fIRu-QEsEuQ", "partnerId": "CLhOO5UT6sIk-fIRu-QEsEuQ", "isRegReport": true } ``` -------------------------------- ### Response Samples Source: https://lk.mediascout.ru/webapi/documentation/index.html Provides example response bodies for various HTTP status codes. ```APIDOC ## Response Samples ### Description This section provides example response bodies for successful and error scenarios. ### Response Samples - 200 - 400 - 401 - 403 - 500 ### Content Type application/json ### Example Response (200 OK) ```json [ { "number": "Тест", "date": "2023-04-01", "expirationDate": "2023-05-01", "amount": 100, "isAgentActingForPublisher": true, "isChargePaidByAgent": false, "subjectType": "Distribution", "actionType": "Contracting", "parentMainContractId": "CT0N4ufC76TEu1xBEIwJ3CaA", "id": "CT0N4ufC76TEu1xBEIwJ3CaA", "type": "ServiceAgreement", "status": "Created", "contractorId": "CLhOO5UT6sIk-fIRu-QEsEuQ", "clientId": "CLhOO5UT6sIk-fIRu-QEsEuQ", "finalContractId": "CT0N4ufC76TEu1xBEIwJ3CaA", "contractorInn": "7722643959", "contractorName": "ООО «Ромашка»", "clientInn": "7722643959", "clientName": "ООО «Ромашка»", "cid": "763acd99-687b-46cd-8f40-45eced77413c", "erirValidationError": { "stage": "EntityHeader", "code": "I_82", "message": "В разаллокации присутствует более одного договора", "responseDt": "2019-08-24T14:15:22Z" } } ] ``` ``` -------------------------------- ### Request Payload Example Source: https://lk.mediascout.ru/webapi/documentation/index.html A sample JSON payload for creating or updating a creative group, including various contract, promotion, and targeting details. ```json { "creativeGroupId": "string", "finalContractId": "string", "initialContractId": "string", "cobrandingContractIds": [ "string" ], "isSelfPromotion": true, "creativeGroupName": "string", "startDate": "2019-08-24", "endDate": "2019-08-24", "type": "CPM", "form": "Banner", "isNative": true, "isSocial": true, "isSocialQuota": true, "isCobranding": true, "kktuCodes": [ "string" ], "targetAudienceParams": [ { "type": "Geo", "values": [ "string" ] } ], "description": "string" } ``` -------------------------------- ### JSON Request Payload Example Source: https://lk.mediascout.ru/webapi/documentation/index.html This is a sample JSON payload for making a request to the API. Ensure all required fields are correctly formatted. ```json { "erid": "string", "campaignType": "CPM", "platformId": "string", "publicationUrl": "string", "startTrackingDate": "2019-08-24", "isAutoRegister": true } ``` -------------------------------- ### Request Payload Example Source: https://lk.mediascout.ru/webapi/documentation/index.html This is a sample JSON payload for a request to the MediaScout Web API. It includes fields for transaction details, dates, amounts, and client/partner information. ```json { "number": "Тест", "date": "2023-04-01", "expirationDate": "2023-05-01", "amount": 100, "isAgentActingForPublisher": true, "isChargePaidByAgent": false, "subjectType": "Distribution", "actionType": "Contracting", "parentMainContractId": "CT0N4ufC76TEu1xBEIwJ3CaA", "type": "ServiceAgreement", "clientId": "CLhOO5UT6sIk-fIRu-QEsEuQ", "partnerId": "CLhOO5UT6sIk-fIRu-QEsEuQ" } ``` -------------------------------- ### Get Tracked Statistics Applications Source: https://lk.mediascout.ru/webapi/documentation/index.html Retrieves a list of statistics tracking applications. Supports filtering by ID, creation date range, status, tracking start date, creative token, publication URL, and platform details. Also allows specifying if data should be automatically sent to ERIR. ```APIDOC ## GET /webapi/v3/statistics/tracked ### Description Retrieves a list of statistics tracking applications with filtering capabilities. ### Method GET ### Endpoint /webapi/v3/statistics/tracked ### Parameters #### Query Parameters - **Id** (string) - Optional - The ID of the application. - **CreateDtStart** (string ) - Optional - The start date for filtering by creation date. - **CreateDtEnd** (string ) - Optional - The end date for filtering by creation date. - **Status** (string Enum: "RegistrationRequired" "Registering" "Active" "Error" "CloseRequired" "Closed" "Deleted" "RestoreRequired") - Optional - The status of the application. - **StartTrackingDate** (string ) - Optional - The date when tracking started. - **Erid** (string) - Optional - The creative token (Erid). - **PublicationUrl** (string) - Optional - The URL of the tracked publication. - **PlatformId** (string) - Optional - The ID of the platform or application. - **PlatformName** (string) - Optional - The name of the platform or application. - **PlatformUrl** (string) - Optional - The URL of the platform or application. - **IsAutoRegister** (boolean) - Optional - Whether to automatically send data to ERIR. ### Responses #### Success Response (200) OK Response Schema: application/json Array of campaign objects, each containing: - **campaignType** (string Enum: "CPM" "CPC" "CPA" "Other") - Type of advertising campaign. - **changeDt** (string ) - Date of modification. - **createDt** (string ) - Date of creation. - **currentMonthImpsCount** (integer ) - Impressions count for the current month. - **erid** (string) - Creative token (Erid). - **id** (string) - Application ID. - **isAutoRegister** (boolean) - Whether data is automatically sent to ERIR. - **platformId** (string) - Platform ID. - **platformName** (string) - Platform name. - **publicationUrl** (string) - URL of the tracked publication. - **startTrackingDate** (string ) - Date tracking started. - **status** (string Enum: "RegistrationRequired" "Registering" "Active" "Error" "CloseRequired" "Closed" "Deleted" "RestoreRequired") - Status of the application. - **totalImpsCount** (integer ) - Total impressions count. - **errorsText** (string or null) - Text of errors, if any. - **platformUrl** (string or null) - Platform URL, if available. #### Error Response (400) Bad Request Response Schema: application/problem+json - **errors** (object) - Details of the errors. - **type** (string or null) - URI identifying the error type. - **title** (string or null) - Short error description. - **status** (integer or null) - HTTP status code generated by the server. - **detail** (string or null) - Detailed error description. - **instance** (string or null) - URI identifying the specific error instance. - **additional property** (any) - Additional properties related to the error. #### Error Response (401) Unauthorized Response Schema: application/problem+json - **type** (string or null) - URI identifying the error type. - **title** (string or null) - Short error description. - **status** (integer or null) - HTTP status code generated by the server. - **detail** (string or null) - Detailed error description. - **instance** (string or null) - URI identifying the specific error instance. - **additional property** (any) - Additional properties related to the error. #### Error Response (403) Forbidden ``` -------------------------------- ### Get Platforms Response Sample Source: https://lk.mediascout.ru/webapi/documentation/index.html This is a sample JSON response for a successful request to retrieve platform information. It includes details like name, type, URL, ownership status, and ID. ```json [ { "name": "Тестовая площадка", "type": "Site", "url": "https://example.com", "isOwner": true, "id": "PLCqwqXBhLMk6eTsIQoUT48A" } ] ``` -------------------------------- ### Create Client Source: https://lk.mediascout.ru/webapi/documentation/index.html Use this endpoint to create a new client in the ORD. If a client with the same details already exists, the API will return existing client information. ```bash curl -X POST \ http://localhost:8080/webapi/v3/clients \ -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -u "user:password" \ -d '{ "createMode": "DirectClient", "inn": "1234567890", "legalForm": "JuridicalPerson", "name": "Test Client", "mobilePhone": "+79991234567" }' ``` -------------------------------- ### Request Payload Example Source: https://lk.mediascout.ru/webapi/documentation/index.html Example of a JSON payload for a request, specifying the physical person's address. ```json { "physicalPersonAddress": "string" } ``` -------------------------------- ### Create Client Source: https://lk.mediascout.ru/webapi/documentation/index.html Creates a new client in the system. If a client with the same details already exists, the existing client's information is returned. ```APIDOC ## POST /webapi/v3/clients ### Description Creates a new client in the system. If a client with the same details already exists, the existing client's information is returned. ### Method POST ### Endpoint /webapi/v3/clients ### Parameters #### Request Body - **createMode** (string) - Required - Enum: "DirectClient" "InitialContractClient" - Type of the counterparty's relationship to the agency. * _DirectClient_ - Direct client for the given agency (i.e., can be a customer under final agreements with this agency). * _InitialContractClient_ - Client created as a customer or performer for the initial contract being created. - **inn** (string) - Required - For Russian counterparties - INN. For foreign individuals and legal entities - taxpayer number or its equivalent in the country of registration. - **legalForm** (string) - Required - Enum: "JuridicalPerson" "IndividualEntrepreneur" "PhysicalPerson" "InternationalJuridicalPerson" "InternationalPhysicalPerson" - Legal form of the counterparty. * _JuridicalPerson_ - Russian Legal Entity * _IndividualEntrepreneur_ - Russian Individual Entrepreneur * _PhysicalPerson_ - Russian Individual or Self-Employed * _InternationalJuridicalPerson_ - Foreign Legal Entity * _InternationalPhysicalPerson_ - Foreign Individual - **name** (string) - Required - Name of the counterparty. For Russian individual entrepreneurs and legal entities, it is filled in automatically and the provided value is ignored. - **physicalPersonAddress** (string or null) - Registration address (for individuals/self-employed and individual entrepreneurs). Maximum length 500 characters. - **mobilePhone** (string or null) - Mobile phone number. - **epayNumber** (string or null) - Electronic payment instrument number. - **regNumber** (string or null) - Registration number or its equivalent. - **oksmNumber** (string or null) - Country code for legal entity registration according to OKSM. ### Responses #### Success Response (200) OK ``` -------------------------------- ### Internal Server Error Example Source: https://lk.mediascout.ru/webapi/documentation/index.html An example of a 500 Internal Server Error response, indicating a general server-side error. ```text 500 Internal Server Error ``` -------------------------------- ### Successful Response (200 OK) Source: https://lk.mediascout.ru/webapi/documentation/index.html Example of a successful API response with a status of 'Creating'. This indicates the ad item has been created in the system but media data is still being uploaded. ```json { "status": "Creating" } ``` -------------------------------- ### Create Platform Source: https://lk.mediascout.ru/webapi/documentation/index.html Creates a new advertising platform. Supports Site, Application, SmartTv, and HbbTv types. Rate limiting applies. ```APIDOC ## POST /webapi/v3/platforms ### Description Creates a new advertising platform. Supports Site, Application, SmartTv, and HbbTv types. Rate limiting applies. ### Method POST ### Endpoint /webapi/v3/platforms ### Parameters #### Request Body - **isOwner** (boolean) - Required - Flag indicating ownership by an agency. - **name** (string) - Required - Name of the platform. - **type** (string) - Required - Enum: "Site", "Application", "SmartTv", "HbbTv". Type of the platform. - Site - Website - Application - Application - SmartTv - Smart TV Application - HbbTv - HbbTV Application - **url** (string | null) - Optional - URL of the platform. Required for "Site" and "Application" types, optional for "Smart TV" and "HbbTV". ### Request Example ```json { "isOwner": true, "name": "Example Platform", "type": "Site", "url": "https://example.com" } ``` ### Responses #### Success Response (201) - **id** (string) - Required - Identifier of the created platform. #### Response Example (201) ```json { "id": "platform-12345" } ``` #### Error Responses - **400** Bad Request: Details provided in the `errors` object. - **401** Unauthorized: Authentication failed. - **403** Forbidden: Access denied. - **500** Internal Server Error: An unexpected error occurred on the server. ``` -------------------------------- ### Request Payload Example Source: https://lk.mediascout.ru/webapi/documentation/index.html This is an example of a JSON payload for a request. It includes fields for contract details, dates, amounts, and participant identifiers. ```json { "number": "Тест", "date": "2023-04-01", "expirationDate": "2023-05-01", "amount": 100, "isAgentActingForPublisher": true, "isChargePaidByAgent": false, "subjectType": "Distribution", "actionType": "Contracting", "parentMainContractId": "CT0N4ufC76TEu1xBEIwJ3CaA", "type": "ServiceAgreement", "contractorId": "CLhOO5UT6sIk-fIRu-QEsEuQ", "partnerId": "CLhOO5UT6sIk-fIRu-QEsEuQ" } ``` -------------------------------- ### Request Payload Example Source: https://lk.mediascout.ru/webapi/documentation/index.html This is an example of a JSON payload for a request. It includes fields for contract details, dates, amounts, and participant identifiers. ```json { "number": "Тест", "date": "2023-04-01", "expirationDate": "2023-05-01", "amount": 100, "isAgentActingForPublisher": true, "isChargePaidByAgent": false, "subjectType": "Distribution", "actionType": "Contracting", "parentMainContractId": "CT0N4ufC76TEu1xBEIwJ3CaA", "type": "ServiceAgreement", "contractorId": "CLhOO5UT6sIk-fIRu-QEsEuQ", "clientId": "CLhOO5UT6sIk-fIRu-QEsEuQ", "finalContractId": "CT0N4ufC76TEu1xBEIwJ3CaA" } ``` -------------------------------- ### Response Payload Example (JSON) Source: https://lk.mediascout.ru/webapi/documentation/index.html This sample JSON response represents a successfully created service agreement. It includes all fields from the request, plus additional fields like 'id', 'status', 'contractorInn', 'contractorName', 'clientInn', 'clientName', and an 'erirValidationError' object in case of issues. ```json { "number": "Тест", "date": "2023-04-01", "expirationDate": "2023-05-01", "amount": 100, "isAgentActingForPublisher": true, "isChargePaidByAgent": false, "subjectType": "Distribution", "actionType": "Contracting", "parentMainContractId": "CT0N4ufC76TEu1xBEIwJ3CaA", "id": "CT0N4ufC76TEu1xBEIwJ3CaA", "type": "ServiceAgreement", "status": "Created", "contractorId": "CLhOO5UT6sIk-fIRu-QEsEuQ", "clientId": "CLhOO5UT6sIk-fIRu-QEsEuQ", "finalContractId": "CT0N4ufC76TEu1xBEIwJ3CaA", "contractorInn": "7722643959", "contractorName": "ООО «Ромашка»", "clientInn": "7722643959", "clientName": "ООО «Ромашка»", "cid": "763acd99-687b-46cd-8f40-45eced77413c", "erirValidationError": { "stage": "EntityHeader", "code": "I_82", "message": "В разаллокации присутствует более одного договора", "responseDt": "2019-08-24T14:15:22Z" } } ``` -------------------------------- ### Get List of Invoices Source: https://lk.mediascout.ru/webapi/documentation/index.html Retrieves a list of invoices. Filters can be applied to narrow down the results. To get all invoices, send the request without any parameters. ```APIDOC ## GET /webapi/v3.1/invoices ### Description Retrieves a list of invoices. Filters can be applied to narrow down the results. To get all invoices, send the request without any parameters. ### Method GET ### Endpoint /webapi/v3.1/invoices ### Parameters #### Query Parameters - **Ids** (Array of strings) - Optional - Filter by Invoice IDs in ORD. - **Number** (string) - Optional - Filter by invoice number. - **DateStart** (string ) - Optional - Filter by the start of the invoice date range. - **DateEnd** (string ) - Optional - Filter by the end of the invoice date range. - **FinalContractId** (string) - Optional - Filter by the ID of the income contract in ORD. - **Status** (string) - Optional - Filter by invoice status. Enum: "Creating", "Created", "RegistrationRequired", "Transferring", "Registering", "Active", "RegistrationError", "DeletionPreparing", "DeletionRequired", "DeletionTransferring", "Deleting", "DeletionError", "Deleted", "Blocked", "Hidden". ### Responses #### Success Response (200) OK ``` -------------------------------- ### Get Contract CID Response Schema Source: https://lk.mediascout.ru/webapi/documentation/index.html This is the response schema for the Get Contract CID API. It includes the CID and potentially a newContractId for older contracts. ```json { "cid": "string", "newContractId": "string" } ``` -------------------------------- ### Create Media Platform Source: https://lk.mediascout.ru/webapi/documentation/index.html Allows for the creation of a new media platform entry within the MediaScout system. It requires specifying the platform's name, type, and optionally a URL, along with ownership status. ```APIDOC ## POST /websites/lk_mediascout_ru_webapi ### Description Creates a new media platform with the provided details. ### Method POST ### Endpoint /websites/lk_mediascout_ru_webapi ### Parameters #### Request Body - **name** (string) - Required - Наименование площадки - **type** (string) - Required - Enum: "Site" "Application" "SmartTv" "HbbTv" Тип площадки - **url** (string) - Optional - Url площадки. Поле обязательно для типов площадок "Сайт" и "Приложение", необязательно для "Smart TV" и "HbbTV" - **isOwner** (boolean) - Required - Признак принадлежности агентству ### Request Example ```json { "name": "Тестовая площадка", "type": "Site", "url": "https://example.com", "isOwner": true } ``` ### Response #### Success Response (200) - **id** (string) - Идентификатор площадки - **isOwner** (boolean) - Признак принадлежности агентству - **name** (string) - Наименование площадки - **type** (string) - Enum: "Site" "Application" "SmartTv" "HbbTv" Тип площадки - **url** (string) - Url площадки. #### Response Example ```json { "name": "Тестовая площадка", "type": "Site", "url": "https://example.com", "isOwner": true, "id": "PLCqwqXBhLMk6eTsIQoUT48A" } ``` #### Error Responses - **400** Bad Request: Details in Response Schema: application/problem+json - **401** Unauthorized: Details in Response Schema: application/problem+json - **403** Forbidden: Details in Response Schema: application/problem+json - **500** Internal Server Error: Details in Response Schema: application/problem+json ```