{
  "openapi": "3.0.2",
  "info": {
    "version": "28.0.0.0",
    "description": "Generated on 12-05-2026",
    "title": "CAMP 365 Newsletter API computerCamp/newsletter/v1.0"
  },
  "servers": [
    {
      "url": "https://api.businesscentral.dynamics.com/v2.0/sandbox/api/computerCamp/newsletter/v1.0"
    },
    {
      "url": "https://api.businesscentral.dynamics.com/v2.0/production/api/computerCamp/newsletter/v1.0"
    }
  ],
  "tags": [
    {
      "name": "contacts"
    },
    {
      "name": "newslists"
    }
  ],
  "security": [
    {
      "oAuth2ClientCredentials": [
        "https://api.businesscentral.dynamics.com/.default"
      ]
    },
    {
      "bearerAuth": []
    }
  ],
  "paths": {
    "/contacts": {
      "get": {
        "description": "Used to display a list of newsletter recipients. Filters can be applied to one, several or no fields<br><br>Permissions: Read and write<br>Returns: A list of newsletter recipients<br>Conditions: None<br><br>Examples:<br>GET:<br>All recipients: {environment}/api/computerCamp/newsletter/v1.0/companies({company})/contacts<br>A recipient from code: {environment}/api/computerCamp/newsletter/v1.0/companies({company})/contacts?$filter=no eq '{no}'<br>A range of contacts: {environment}/api/computerCamp/newsletter/v1.0/companies({company})/contacts?$filter=no gt '{no1}' and no lt '{no2}'",
        "summary": "Get entities from contacts",
        "tags": [
          "contacts"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/company"
          },
          {
            "$ref": "#/components/parameters/top"
          },
          {
            "$ref": "#/components/parameters/skip"
          },
          {
            "$ref": "#/components/parameters/search"
          },
          {
            "name": "$filter",
            "description": "Filter items by property values, see [Filtering](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionfilter)",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/count"
          },
          {
            "name": "$orderby",
            "description": "Order items by property values, see [Sorting](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionorderby)",
            "in": "query",
            "explode": false,
            "schema": {
              "type": "array",
              "uniqueItems": true,
              "items": {
                "type": "string",
                "enum": [
                  "systemId",
                  "systemId desc",
                  "no",
                  "no desc",
                  "contactNo",
                  "contactNo desc",
                  "contactName",
                  "contactName desc",
                  "listCode",
                  "listCode desc",
                  "listName",
                  "listName desc",
                  "unsubscribed",
                  "unsubscribed desc",
                  "hasOptedOut",
                  "hasOptedOut desc"
                ]
              }
            }
          },
          {
            "name": "$select",
            "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)",
            "in": "query",
            "explode": false,
            "schema": {
              "type": "array",
              "uniqueItems": true,
              "items": {
                "type": "string",
                "enum": [
                  "systemId",
                  "no",
                  "contactNo",
                  "contactName",
                  "listCode",
                  "listName",
                  "unsubscribed",
                  "hasOptedOut"
                ]
              }
            }
          },
          {
            "name": "$expand",
            "description": "Select navigation properties to be returned, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)",
            "in": "query",
            "explode": false,
            "schema": {
              "type": "array",
              "uniqueItems": true,
              "items": {
                "type": "string",
                "enum": [
                  "newslist"
                ]
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Retrieved entities",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "title": "Collection of contact",
                  "properties": {
                    "@odata.count": {
                      "$ref": "#/components/schemas/count"
                    },
                    "value": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Microsoft.NAV.contact"
                      }
                    }
                  }
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/error"
          }
        }
      },
      "post": {
        "summary": "Add new entity to contacts",
        "tags": [
          "contacts"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/company"
          }
        ],
        "requestBody": {
          "description": "New entity",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Microsoft.NAV.contact-create"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.NAV.contact"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/contacts({systemId})": {
      "parameters": [
        {
          "description": "key: systemId",
          "in": "path",
          "name": "systemId",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid",
            "example": "01234567-89ab-cdef-0123-456789abcdef"
          }
        },
        {
          "$ref": "#/components/parameters/company"
        }
      ],
      "get": {
        "summary": "Get entity from contacts by key",
        "tags": [
          "contacts"
        ],
        "parameters": [
          {
            "name": "$select",
            "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)",
            "in": "query",
            "explode": false,
            "schema": {
              "type": "array",
              "uniqueItems": true,
              "items": {
                "type": "string",
                "enum": [
                  "systemId",
                  "no",
                  "contactNo",
                  "contactName",
                  "listCode",
                  "listName",
                  "unsubscribed",
                  "hasOptedOut"
                ]
              }
            }
          },
          {
            "name": "$expand",
            "description": "Select navigation properties to be returned, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)",
            "in": "query",
            "explode": false,
            "schema": {
              "type": "array",
              "uniqueItems": true,
              "items": {
                "type": "string",
                "enum": [
                  "newslist"
                ]
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Retrieved entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.NAV.contact"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/error"
          }
        }
      },
      "patch": {
        "summary": "Update entity in contacts",
        "tags": [
          "contacts"
        ],
        "requestBody": {
          "description": "New property values",
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Microsoft.NAV.contact-update"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Success"
          },
          "4XX": {
            "$ref": "#/components/responses/error"
          }
        }
      },
      "delete": {
        "summary": "Delete entity from contacts",
        "tags": [
          "contacts"
        ],
        "responses": {
          "204": {
            "description": "Success"
          },
          "4XX": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/newslists": {
      "get": {
        "description": "Used to display a list of newsletters. Filters can be applied to one, several or no fields<br><br>Permissions: Read<br>Returns: A list of newsletters<br>Conditions: None<br><br>Examples:<br>GET:<br>All newsletters: {environment}/api/computerCamp/newsletter/v1.0/companies({company})/newsletters<br>A newsletter from code: {environment}/api/computerCamp/newsletter/v1.0/companies({company})/newsletters?$filter=code eq '{code}'<br>A range of newsletters: {environment}/api/computerCamp/newsletter/v1.0/companies({company})/newsletters?$filter=code gt '{code1}' and code lt '{code2}'",
        "summary": "Get entities from newslists",
        "tags": [
          "newslists"
        ],
        "parameters": [
          {
            "$ref": "#/components/parameters/company"
          },
          {
            "$ref": "#/components/parameters/top"
          },
          {
            "$ref": "#/components/parameters/skip"
          },
          {
            "$ref": "#/components/parameters/search"
          },
          {
            "name": "$filter",
            "description": "Filter items by property values, see [Filtering](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionfilter)",
            "in": "query",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/count"
          },
          {
            "name": "$orderby",
            "description": "Order items by property values, see [Sorting](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionorderby)",
            "in": "query",
            "explode": false,
            "schema": {
              "type": "array",
              "uniqueItems": true,
              "items": {
                "type": "string",
                "enum": [
                  "systemId",
                  "systemId desc",
                  "code",
                  "code desc",
                  "name",
                  "name desc"
                ]
              }
            }
          },
          {
            "name": "$select",
            "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)",
            "in": "query",
            "explode": false,
            "schema": {
              "type": "array",
              "uniqueItems": true,
              "items": {
                "type": "string",
                "enum": [
                  "systemId",
                  "code",
                  "name"
                ]
              }
            }
          },
          {
            "name": "$expand",
            "description": "Select navigation properties to be returned, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)",
            "in": "query",
            "explode": false,
            "schema": {
              "type": "array",
              "uniqueItems": true,
              "items": {
                "type": "string",
                "enum": [
                  null
                ]
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Retrieved entities",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "title": "Collection of newslist",
                  "properties": {
                    "@odata.count": {
                      "$ref": "#/components/schemas/count"
                    },
                    "value": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Microsoft.NAV.newslist"
                      }
                    }
                  }
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/newslists({systemId})": {
      "parameters": [
        {
          "description": "key: systemId",
          "in": "path",
          "name": "systemId",
          "required": true,
          "schema": {
            "type": "string",
            "format": "uuid",
            "example": "01234567-89ab-cdef-0123-456789abcdef"
          }
        },
        {
          "$ref": "#/components/parameters/company"
        }
      ],
      "get": {
        "summary": "Get entity from newslists by key",
        "tags": [
          "newslists"
        ],
        "parameters": [
          {
            "name": "$select",
            "description": "Select properties to be returned, see [Select](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionselect)",
            "in": "query",
            "explode": false,
            "schema": {
              "type": "array",
              "uniqueItems": true,
              "items": {
                "type": "string",
                "enum": [
                  "systemId",
                  "code",
                  "name"
                ]
              }
            }
          },
          {
            "name": "$expand",
            "description": "Select navigation properties to be returned, see [Expand](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionexpand)",
            "in": "query",
            "explode": false,
            "schema": {
              "type": "array",
              "uniqueItems": true,
              "items": {
                "type": "string",
                "enum": [
                  null
                ]
              }
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Retrieved entity",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Microsoft.NAV.newslist"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    },
    "/$batch": {
      "post": {
        "summary": "Send a group of requests",
        "description": "Group multiple requests into a single request payload, see [Batch Requests](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_BatchRequests).\n\n*Please note that \"Try it out\" is not supported for this request.*",
        "tags": [
          "Batch Requests"
        ],
        "requestBody": {
          "required": true,
          "description": "Batch request",
          "content": {
            "multipart/mixed;boundary=request-separator": {
              "example": "--request-separator\nContent-Type: application/http\nContent-Transfer-Encoding: binary\n\nGET educations HTTP/1.1\nAccept: application/json\n\n\n--request-separator--",
              "schema": {
                "type": "string"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Batch response",
            "content": {
              "multipart/mixed": {
                "example": "--response-separator\nContent-Type: application/http\n\nHTTP/1.1 200 OK\nContent-Type: application/json\n\n{...}\n--response-separator--",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "4XX": {
            "$ref": "#/components/responses/error"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "Microsoft.NAV.contact": {
        "title": "contact",
        "type": "object",
        "properties": {
          "systemId": {
            "description": "The unique system-generated identifier for this contact entry.",
            "type": "string",
            "format": "uuid",
            "example": "01234567-89ab-cdef-0123-456789abcdef"
          },
          "no": {
            "description": "The contact list entry number that uniquely identifies this recipient record.",
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "string"
              }
            ],
            "format": "int64",
            "example": "42",
            "nullable": true
          },
          "contactNo": {
            "description": "The Business Central contact number linked to this newsletter recipient.",
            "type": "string",
            "maxLength": 20,
            "nullable": true
          },
          "contactName": {
            "description": "The full name of the contact as retrieved from the linked Business Central contact record.",
            "type": "string",
            "maxLength": 100,
            "nullable": true
          },
          "listCode": {
            "description": "The code of the newsletter list this contact is subscribed to.",
            "type": "string",
            "maxLength": 10,
            "nullable": true
          },
          "listName": {
            "description": "The name of the newsletter list this contact is subscribed to.",
            "type": "string",
            "maxLength": 50,
            "nullable": true
          },
          "unsubscribed": {
            "description": "Indicates whether the contact has been unsubscribed from the newsletter list. True means the contact will not receive mailings.",
            "type": "boolean",
            "nullable": true
          },
          "hasOptedOut": {
            "description": "Indicates whether the contact has explicitly opted out of all newsletter communication.",
            "type": "boolean",
            "nullable": true
          }
        }
      },
      "Microsoft.NAV.contact-create": {
        "title": "contact (for create)",
        "type": "object",
        "properties": {
          "no": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "string"
              }
            ],
            "format": "int64",
            "example": "42",
            "nullable": true
          },
          "contactNo": {
            "type": "string",
            "maxLength": 20,
            "nullable": true
          },
          "listCode": {
            "type": "string",
            "maxLength": 10,
            "nullable": true
          },
          "hasOptedOut": {
            "type": "boolean",
            "nullable": true
          }
        },
        "required": []
      },
      "Microsoft.NAV.contact-update": {
        "title": "contact (for update)",
        "type": "object",
        "properties": {
          "no": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "string"
              }
            ],
            "format": "int64",
            "example": "42",
            "nullable": true
          },
          "contactNo": {
            "type": "string",
            "maxLength": 20,
            "nullable": true
          },
          "listCode": {
            "type": "string",
            "maxLength": 10,
            "nullable": true
          },
          "hasOptedOut": {
            "type": "boolean",
            "nullable": true
          }
        }
      },
      "Microsoft.NAV.newslist": {
        "title": "newslist",
        "type": "object",
        "properties": {
          "systemId": {
            "description": "",
            "type": "string",
            "format": "uuid",
            "example": "01234567-89ab-cdef-0123-456789abcdef"
          },
          "code": {
            "description": "",
            "type": "string",
            "maxLength": 10,
            "nullable": true
          },
          "name": {
            "description": "",
            "type": "string",
            "maxLength": 50,
            "nullable": true
          }
        }
      },
      "count": {
        "anyOf": [
          {
            "minimum": 0,
            "type": "integer"
          },
          {
            "type": "string"
          }
        ],
        "description": "The number of entities in the collection. Available when using the [$count](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptioncount) query option."
      },
      "error": {
        "type": "object",
        "required": [
          "error"
        ],
        "properties": {
          "error": {
            "type": "object",
            "required": [
              "code",
              "message"
            ],
            "properties": {
              "code": {
                "type": "string"
              },
              "message": {
                "type": "string"
              },
              "target": {
                "type": "string"
              },
              "details": {
                "type": "array",
                "items": {
                  "type": "object",
                  "required": [
                    "code",
                    "message"
                  ],
                  "properties": {
                    "code": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "target": {
                      "type": "string"
                    }
                  }
                }
              },
              "innererror": {
                "type": "object",
                "description": "The structure of this object is service-specific"
              }
            }
          }
        }
      }
    },
    "parameters": {
      "company": {
        "description": "Kan findes i Business Central ved at &aring;bne siden regnskabsoversigt, v&aelig;lg derefter det &oslash;nskede regnskab. &Aring;bn inspectoren ved at trykke ctrl+alt+F1. Marker v&aelig;rdien i feltet &quot;id&quot; ved at triple-klikke og kopier v&aelig;rdien.",
        "required": true,
        "in": "query",
        "schema": {
          "type": "string"
        },
        "name": "company"
      },
      "top": {
        "name": "$top",
        "in": "query",
        "description": "Show only the first n items, see [Paging - Top](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptiontop)",
        "schema": {
          "type": "integer",
          "minimum": 0
        },
        "example": 50
      },
      "skip": {
        "name": "$skip",
        "in": "query",
        "description": "Skip the first n items, see [Paging - Skip](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionskip)",
        "schema": {
          "type": "integer",
          "minimum": 0
        }
      },
      "count": {
        "name": "$count",
        "in": "query",
        "description": "Include count of items, see [Count](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptioncount)",
        "schema": {
          "type": "boolean"
        }
      },
      "search": {
        "name": "$search",
        "in": "query",
        "description": "Search items by search phrases, see [Searching](http://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html#sec_SystemQueryOptionsearch)",
        "schema": {
          "type": "string"
        }
      }
    },
    "responses": {
      "error": {
        "description": "Error",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/error"
            }
          }
        }
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "bearerFormat": "JwT",
        "description": "<h5><i>Hvis du vil teste i Swagger UI, skal du anvende denne.</i></h5>",
        "scheme": "bearer"
      },
      "oAuth2ClientCredentials": {
        "type": "oauth2",
        "flows": {
          "clientCredentials": {
            "tokenUrl": "https://login.microsoftonline.com/camp1.onmicrosoft.com/oauth2/v2.0/token",
            "scopes": {
              "https://api.businesscentral.dynamics.com/.default": "Default permissions"
            }
          }
        },
        "description": "<h5><i>HUSK at inds&aelig;tte dit tenant id eller dom&aelig;ne.</i></h5>"
      }
    }
  }
}
