{
  "swagger" : "2.0",
  "info" : {
    "description" : "The Partner Catalog API is an API for updating and retrieving information from the directory database, i.e. query and update information for a user or enterprise. In particular,the API can be used for creating, updating, retrieving and deleting Contacts. It also offers the possibility to get a list of Contacts changed after a given time, and retrieve the enterprise for a groupId. \n\nNote that POST and PUT methods require an extra pay load parameter (discriminator) \"@type\" to specify the name of the object to create or update. Example '\"@type\": \"Contact\"'. ",
    "version" : "1.0",
    "title" : "Partner Catalog API"
  },
  "host" : "apis.telenor.se",
  "basePath" : "/mbn-partner-catalog-api/v1/",
  "tags" : [ {
    "name" : "Partner Catalog API"
  } ],
  "schemes" : [ "https" ],
  "consumes" : [ "application/json" ],
  "produces" : [ "application/json" ],
  "paths" : {
    "/catalog/userInfo" : {
      "get" : {
        "tags" : [ "Partner Catalog API" ],
        "summary" : "Get user info",
        "description" : "Get the agreementId. The agreementId parameter is to be used as groupId in header, and as companyId for API requests with these parameter requirements. ",
        "operationId" : "getUserInfo",
        "parameters" : [ {
          "name" : "Authorization",
          "in" : "header",
          "description" : "OAuth 2.0 Authorization. Token provided via https://apis.telenor.se/openapi/oauth2/token API.",
          "required" : true,
          "type" : "string",
          "x-example" : "Bearer Ca5lRGqLdD9m7LXSBAo0tKEpQGkd"
        }, {
          "name" : "x-jwt",
          "in" : "header",
          "description" : "A jwt that has been created via https://apis.telenor.se/b2b/partner/auth/right/hasPermission/partner",
          "required" : true,
          "type" : "string",
          "x-example" : "eyJhbGciOiJsUzI1NiJ9.eyJpc3MiOiJUZwXlbm9yIFN3ZWRlbiIsImF1zCI6IlrTryIsInN1yiI6IjmyndIymJAiLcJPyzqiOje7ODB8Nzg5MzUSImv5cCI6MTy8Msy4mjAznX0.UdtcbgHUd43uTfPJ1bEfg7jXcDfvbyD04W_S5tjljSHRzYycOCqbYvMpm8AEV5KuwZxG573dDc0p_nvGKeSj4G2f-an3N3VyaAiiKNHFG2ML2Ta6nZgj_-Pi0cNzMhM6R_7_ggaCS0UGnEEUWO-GQSj0D-VnEeJ5sUOWc-SYEXdT9KBynmU5xqQKktIQz7YMc0_TPpDk4uc0XR3ja5yLLOMIx1ZuHloRITeMUZ0s-I9NYGHgD_b8H62GzL94jDjOEYSzwqPyWXeZksfQNxzdD2UrDaZdZ1YDMhz5GigSdvK07maYH8SJnjTtXIaM7jw-uGjxOElUMrgKK6ZNqqoORw"
        } ],
        "responses" : {
          "200" : {
            "description" : "getUserInfo succeeded",
            "schema" : {
              "$ref" : "#/definitions/PartnerUserInfoResponse"
            }
          },
          "400" : {
            "description" : "Bad request: The request was malformed or not according to the specification.",
            "schema" : {
              "$ref" : "#/definitions/ErrorDescriptionResponse"
            }
          },
          "401" : {
            "description" : "Unauthorized: You have either not provided a valid token or the token provided is not valid.",
            "schema" : {
              "$ref" : "#/definitions/ErrorDescriptionResponse"
            }
          },
          "403" : {
            "description" : "Forbidden: You are authenticated, but are not authorized and can not access this resource",
            "schema" : {
              "$ref" : "#/definitions/ErrorDescriptionResponse"
            }
          },
          "500" : {
            "description" : "Internal server error: Something unexpected happened.",
            "schema" : {
              "$ref" : "#/definitions/ErrorDescriptionResponse"
            }
          }
        }
      }
    },
    "/catalog/contacts" : {
      "get" : {
        "tags" : [ "Partner Catalog API" ],
        "summary" : "Get contacts",
        "description" : "Search in Contacts with the specified sorters and filters for a given groupId.\n\n filter: A list of key-value pairs (bound with double colon '::'), separated with vertical bar '|'. Example: To get a specific Contact with contact id 1234567: 'id::1234567'. To filter on lastname, firstname and company: 'lastname::Smith|firstname::John|company::XYZ'\n\nsort: A list of fields to apply as sorters, separated with vertical bar '|'. To sort in descending order, prefix with dash '-'. Example 'lastname|firstname|-phonenumber'\n\nchangedLaterThan: Only return Contacts with time changed later than this milliseconds value (in milliseconds since January 1, 1970).\n\noffset: Parameter to manage start item in search result. Default is 0, meaning that the first result will be included.\n\nmaxResult: Parameter to manage maximum number of search result. Default is 100. Example, to retrieve the range of items 50-150 in a total search result of 200, let offset = 49 and maxResult = 100",
        "operationId" : "getContacts",
        "parameters" : [ {
          "name" : "Authorization",
          "in" : "header",
          "description" : "OAuth 2.0 Authorization. Token provided via https://apis.telenor.se/openapi/oauth2/token API.",
          "required" : true,
          "type" : "string",
          "x-example" : "Bearer Ca5lRGqLdD9m7LXSBAo0tKEpQGkd"
        }, {
          "name" : "x-jwt",
          "in" : "header",
          "description" : "A jwt that has been created via https://apis.telenor.se/b2b/partner/auth/right/hasPermission/partner",
          "required" : true,
          "type" : "string",
          "x-example" : "eyJhbGciOiJsUzI1NiJ9.eyJpc3MiOiJUZwXlbm9yIFN3ZWRlbiIsImF1zCI6IlrTryIsInN1yiI6IjmyndIymJAiLcJPyzqiOje7ODB8Nzg5MzUSImv5cCI6MTy8Msy4mjAznX0.UdtcbgHUd43uTfPJ1bEfg7jXcDfvbyD04W_S5tjljSHRzYycOCqbYvMpm8AEV5KuwZxG573dDc0p_nvGKeSj4G2f-an3N3VyaAiiKNHFG2ML2Ta6nZgj_-Pi0cNzMhM6R_7_ggaCS0UGnEEUWO-GQSj0D-VnEeJ5sUOWc-SYEXdT9KBynmU5xqQKktIQz7YMc0_TPpDk4uc0XR3ja5yLLOMIx1ZuHloRITeMUZ0s-I9NYGHgD_b8H62GzL94jDjOEYSzwqPyWXeZksfQNxzdD2UrDaZdZ1YDMhz5GigSdvK07maYH8SJnjTtXIaM7jw-uGjxOElUMrgKK6ZNqqoORw"
        }, {
          "name" : "groupId",
          "in" : "header",
          "description" : "An ID uniquely identifying a company in our systems. <br />A company may have multiple departments but the groupId would be the same for all of them",
          "required" : true,
          "type" : "string",
          "x-example" : "1234567"
        }, {
          "name" : "filter",
          "in" : "query",
          "description" : "input filters are used to filter the resulting response according key/value pairs. <br />The pipe symbol is used to separate multiple filters and double-colon to separate key from value. <br /> Nonexisting filters will be ignored.<br /> Here is an example filter string: <b>\"filtername1::value1|filtername2::value\"</b>. Input filters are supported for the following fields: <ul><li><b>firstname</b></li><li><b>lastname</b></li><li><b>primarynumber</b>(use international format without \"+\": example 4612345678)</li><li><b>company</b></li><li><b>zip</b></li></li><li><b>address</b></li><li><b>email</b></li><li><b>custvalue0 - custvalue9</b></li><li><b>aboutme</b></li><li><b>contacttype</b></li><li><b>departmentid</b></li></ul>",
          "required" : false,
          "type" : "string",
          "x-example" : "name::John Smith|company::ExampleCompany LTD"
        }, {
            "name" : "changedLaterThan",
            "in" : "query",
            "description" : "Date time threshold of when contact was last changed, in milliseconds since January 1, 1970, 00:00:00 GMT.",
            "required" : false,
            "type" : "integer",
            "format" : "int64"
          }, {
          "name" : "sort",
          "in" : "query",
          "description" : "input sorters are used to sort the resulting response list according to field(s).<br /> the pipe symbol is used to separate multiple sorters.<br /> Here is an example sort string: <b>\"queuenumber|externalnumber|-id\"</b>. <br />Specifying a field without a prefix applies ascending sorting and <br />using the \"-\" prefix before a field's name - descending sorting <br />Input sorters are supported for the following fields: ",
          "required" : false,
          "type" : "string",
          "x-example" : "param1|param2|-id"
        }, {
          "name" : "offset",
          "in" : "query",
          "description" : "A number representing starting point for fetching data from a data set",
          "required" : false,
          "type" : "integer",
          "default" : 0,
          "format" : "int32",
          "x-example" : 0
        }, {
          "name" : "maxResults",
          "in" : "query",
          "description" : "Threshold value of maximum returned items in response",
          "required" : false,
          "type" : "integer",
          "default" : 100,
          "format" : "int32",
          "x-example" : 100
        } ],
        "responses" : {
          "200" : {
            "description" : "getContacts succeeded",
            "schema" : {
              "$ref" : "#/definitions/PartnerContactsResponse"
            }
          },
          "400" : {
            "description" : "Bad request: The request was malformed or not according to the specification.",
            "schema" : {
              "$ref" : "#/definitions/ErrorDescriptionResponse"
            }
          },
          "401" : {
            "description" : "Unauthorized: You have either not provided a valid token or the token provided is not valid.",
            "schema" : {
              "$ref" : "#/definitions/ErrorDescriptionResponse"
            }
          },
          "403" : {
            "description" : "Forbidden: You are authenticated, but are not authorized and can not access this resource",
            "schema" : {
              "$ref" : "#/definitions/ErrorDescriptionResponse"
            }
          },
          "500" : {
            "description" : "Internal server error: Something unexpected happened.",
            "schema" : {
              "$ref" : "#/definitions/ErrorDescriptionResponse"
            }
          }
        }
      },
      "post" : {
        "tags" : [ "Partner Catalog API" ],
        "summary" : "Create contact",
        "description" : "Create a Contact in the organization given by groupId. Phone numbers will be validated before creating the Contact. \n\n<b>Note:</b> Only exeternal contacts (type=2) are allowed to be created.</b>\n\n<b>Note 2:</b>This method require an extra pay load parameter (discriminator) \"@type\" to specify the name of the object to create, normally this should be set to \"Contact\". \nExample '\"@type\": \"Contact\"'.",
        "operationId" : "createContact",
        "parameters" : [ {
          "name" : "Authorization",
          "in" : "header",
          "description" : "OAuth 2.0 Authorization. Token provided via https://apis.telenor.se/openapi/oauth2/token API.",
          "required" : true,
          "type" : "string",
          "x-example" : "Bearer Ca5lRGqLdD9m7LXSBAo0tKEpQGkd"
        }, {
          "name" : "x-jwt",
          "in" : "header",
          "description" : "A jwt that has been created via https://apis.telenor.se/b2b/partner/auth/right/hasPermission/partner",
          "required" : true,
          "type" : "string",
          "x-example" : "eyJhbGciOiJsUzI1NiJ9.eyJpc3MiOiJUZwXlbm9yIFN3ZWRlbiIsImF1zCI6IlrTryIsInN1yiI6IjmyndIymJAiLcJPyzqiOje7ODB8Nzg5MzUSImv5cCI6MTy8Msy4mjAznX0.UdtcbgHUd43uTfPJ1bEfg7jXcDfvbyD04W_S5tjljSHRzYycOCqbYvMpm8AEV5KuwZxG573dDc0p_nvGKeSj4G2f-an3N3VyaAiiKNHFG2ML2Ta6nZgj_-Pi0cNzMhM6R_7_ggaCS0UGnEEUWO-GQSj0D-VnEeJ5sUOWc-SYEXdT9KBynmU5xqQKktIQz7YMc0_TPpDk4uc0XR3ja5yLLOMIx1ZuHloRITeMUZ0s-I9NYGHgD_b8H62GzL94jDjOEYSzwqPyWXeZksfQNxzdD2UrDaZdZ1YDMhz5GigSdvK07maYH8SJnjTtXIaM7jw-uGjxOElUMrgKK6ZNqqoORw"
        }, {
          "name" : "groupId",
          "in" : "header",
          "description" : "An ID uniquely identifying a company in our systems. <br />A company may have multiple departments but the groupId would be the same for all of them",
          "required" : true,
          "type" : "string",
          "x-example" : "EF1234567"
        }, {
          "in" : "body",
          "name" : "body",
          "description" : "A json object representing a Contact. Don't forget to include @type",
          "required" : true,
          "schema" : {
            "$ref" : "#/definitions/Contact"
          }
        } ],
        "responses" : {
          "200" : {
            "description" : "createContact succeeded",
            "schema" : {
              "$ref" : "#/definitions/PartnerContactResponse"
            }
          },
          "400" : {
            "description" : "Bad request: The request was malformed or not according to the specification.",
            "schema" : {
              "$ref" : "#/definitions/ErrorDescriptionResponse"
            }
          },
          "401" : {
            "description" : "Unauthorized: You have either not provided a valid token or the token provided is not valid.",
            "schema" : {
              "$ref" : "#/definitions/ErrorDescriptionResponse"
            }
          },
          "403" : {
            "description" : "Forbidden: You are authenticated, but are not authorized and can not access this resource",
            "schema" : {
              "$ref" : "#/definitions/ErrorDescriptionResponse"
            }
          },
          "500" : {
            "description" : "Internal server error: Something unexpected happened.",
            "schema" : {
              "$ref" : "#/definitions/ErrorDescriptionResponse"
            }
          }
        }
      }
    },
    "/catalog/contacts/{userId}" : {
      "put" : {
        "tags" : [ "Partner Catalog API" ],
        "summary" : "Update contact",
        "description" : "Updates the Contact in the organization given by groupId, and for a user userId. userId path-parameter will be used if userId of Contact is null. If these two values are different, an error will be thrown. A Contact can not be updated if the contact type does not match with type of existing Contact, or if the Department for the Contact does not exist. \n\nThe Contact.type and @type are the only required payload-parameters. The Contact.firstName and Contact.lastName will be set to empty values if they are not provided. \n\n<b>Note:</b>This method require an extra pay load parameter (discriminator) \"@type\" to specify the name of the object to update. \nExample '\"@type\": \"Contact\"'.\n\n<b>Note 2:</b>The complete contact needs to sent when updating. Parameters not includded will be set to null.",
        "operationId" : "updateContact",
        "parameters" : [ {
            "name" : "Authorization",
            "in" : "header",
            "description" : "OAuth 2.0 Authorization. Token provided via https://apis.telenor.se/openapi/oauth2/token API.",
            "required" : true,
            "type" : "string",
            "x-example" : "Bearer Ca5lRGqLdD9m7LXSBAo0tKEpQGkd"
          }, {
            "name" : "x-jwt",
            "in" : "header",
            "description" : "A jwt that has been created via https://apis.telenor.se/b2b/partner/auth/right/hasPermission/partner",
            "required" : true,
            "type" : "string",
            "x-example" : "eyJhbGciOiJsUzI1NiJ9.eyJpc3MiOiJUZwXlbm9yIFN3ZWRlbiIsImF1zCI6IlrTryIsInN1yiI6IjmyndIymJAiLcJPyzqiOje7ODB8Nzg5MzUSImv5cCI6MTy8Msy4mjAznX0.UdtcbgHUd43uTfPJ1bEfg7jXcDfvbyD04W_S5tjljSHRzYycOCqbYvMpm8AEV5KuwZxG573dDc0p_nvGKeSj4G2f-an3N3VyaAiiKNHFG2ML2Ta6nZgj_-Pi0cNzMhM6R_7_ggaCS0UGnEEUWO-GQSj0D-VnEeJ5sUOWc-SYEXdT9KBynmU5xqQKktIQz7YMc0_TPpDk4uc0XR3ja5yLLOMIx1ZuHloRITeMUZ0s-I9NYGHgD_b8H62GzL94jDjOEYSzwqPyWXeZksfQNxzdD2UrDaZdZ1YDMhz5GigSdvK07maYH8SJnjTtXIaM7jw-uGjxOElUMrgKK6ZNqqoORw"
          }, {
          "name" : "groupId",
          "in" : "header",
          "description" : "An ID uniquely identifying a company in our systems. <br />A company may have multiple departments but the groupId would be the same for all of them",
          "required" : true,
          "type" : "string",
          "x-example" : "EF1234567"
        }, {
          "name" : "userId",
          "in" : "path",
          "description" : "A numerical ID uniquely identifying the user in our system",
          "required" : true,
          "type" : "integer",
          "format" : "int64",
          "x-example" : 1234
        }, {
          "in" : "body",
          "name" : "body",
          "description" : "A json object representing a Contact. Don't forget to include @type",
          "required" : true,
          "schema" : {
            "$ref" : "#/definitions/Contact"
          }
        } ],
        "responses" : {
          "200" : {
            "description" : "updateContact succeeded",
            "schema" : {
              "$ref" : "#/definitions/PartnerContactResponse"
            }
          },
          "400" : {
            "description" : "Bad request: The request was malformed or not according to the specification.",
            "schema" : {
              "$ref" : "#/definitions/ErrorDescriptionResponse"
            }
          },
          "401" : {
            "description" : "Unauthorized: You have either not provided a valid token or the token provided is not valid.",
            "schema" : {
              "$ref" : "#/definitions/ErrorDescriptionResponse"
            }
          },
          "403" : {
            "description" : "Forbidden: You are authenticated, but are not authorized and can not access this resource",
            "schema" : {
              "$ref" : "#/definitions/ErrorDescriptionResponse"
            }
          },
          "500" : {
            "description" : "Internal server error: Something unexpected happened.",
            "schema" : {
              "$ref" : "#/definitions/ErrorDescriptionResponse"
            }
          }
        }
      },
      "delete" : {
        "tags" : [ "Partner Catalog API" ],
        "summary" : "Delete contact",
        "description" : "Deletes a Contact identified by userId of an organization groupId. userId must have write access and not be a Member.",
        "operationId" : "deleteContact",
        "consumes" : [ "*/*" ],
        "parameters" : [  {
          "name" : "Authorization",
          "in" : "header",
          "description" : "OAuth 2.0 Authorization. Token provided via https://apis.telenor.se/openapi/oauth2/token API.",
          "required" : true,
          "type" : "string",
          "x-example" : "Bearer Ca5lRGqLdD9m7LXSBAo0tKEpQGkd"
        }, {
          "name" : "x-jwt",
          "in" : "header",
          "description" : "A jwt that has been created via https://apis.telenor.se/b2b/partner/auth/right/hasPermission/partner",
          "required" : true,
          "type" : "string",
          "x-example" : "eyJhbGciOiJsUzI1NiJ9.eyJpc3MiOiJUZwXlbm9yIFN3ZWRlbiIsImF1zCI6IlrTryIsInN1yiI6IjmyndIymJAiLcJPyzqiOje7ODB8Nzg5MzUSImv5cCI6MTy8Msy4mjAznX0.UdtcbgHUd43uTfPJ1bEfg7jXcDfvbyD04W_S5tjljSHRzYycOCqbYvMpm8AEV5KuwZxG573dDc0p_nvGKeSj4G2f-an3N3VyaAiiKNHFG2ML2Ta6nZgj_-Pi0cNzMhM6R_7_ggaCS0UGnEEUWO-GQSj0D-VnEeJ5sUOWc-SYEXdT9KBynmU5xqQKktIQz7YMc0_TPpDk4uc0XR3ja5yLLOMIx1ZuHloRITeMUZ0s-I9NYGHgD_b8H62GzL94jDjOEYSzwqPyWXeZksfQNxzdD2UrDaZdZ1YDMhz5GigSdvK07maYH8SJnjTtXIaM7jw-uGjxOElUMrgKK6ZNqqoORw"
        },{
          "name" : "groupId",
          "in" : "header",
          "description" : "An ID uniquely identifying a company in our systems. <br />A company may have multiple departments but the groupId would be the same for all of them",
          "required" : true,
          "type" : "string",
          "x-example" : "EF1234567"
        }, {
          "name" : "userId",
          "in" : "path",
          "description" : "A numerical ID uniquely identifying the user in our system",
          "required" : true,
          "type" : "integer",
          "format" : "int64",
          "x-example" : 1234
        } ],
        "responses" : {
          "200" : {
            "description" : "deleteContact succeeded"
          },
          "400" : {
            "description" : "Bad request: The request was malformed or not according to the specification.",
            "schema" : {
              "$ref" : "#/definitions/ErrorDescriptionResponse"
            }
          },
          "401" : {
            "description" : "Unauthorized: You have either not provided a valid token or the token provided is not valid.",
            "schema" : {
              "$ref" : "#/definitions/ErrorDescriptionResponse"
            }
          },
          "403" : {
            "description" : "Forbidden: You are authenticated, but are not authorized and can not access this resource",
            "schema" : {
              "$ref" : "#/definitions/ErrorDescriptionResponse"
            }
          },
          "500" : {
            "description" : "Internal server error: Something unexpected happened.",
            "schema" : {
              "$ref" : "#/definitions/ErrorDescriptionResponse"
            }
          }
        }
      }
    },
    "/catalog/contacts/changed" : {
      "get" : {
        "tags" : [ "Partner Catalog API" ],
        "summary" : "Get contacts changed after the given date",
        "description" : "Get a list of Contact changed or deleted since the time specified with the changedLaterThan parameter.  ",
        "operationId" : "getChangedContacts",
        "parameters" : [  {
          "name" : "Authorization",
          "in" : "header",
          "description" : "OAuth 2.0 Authorization. Token provided via https://apis.telenor.se/openapi/oauth2/token API.",
          "required" : true,
          "type" : "string",
          "x-example" : "Bearer Ca5lRGqLdD9m7LXSBAo0tKEpQGkd"
        }, {
          "name" : "x-jwt",
          "in" : "header",
          "description" : "A jwt that has been created via https://apis.telenor.se/b2b/partner/auth/right/hasPermission/partner",
          "required" : true,
          "type" : "string",
          "x-example" : "eyJhbGciOiJsUzI1NiJ9.eyJpc3MiOiJUZwXlbm9yIFN3ZWRlbiIsImF1zCI6IlrTryIsInN1yiI6IjmyndIymJAiLcJPyzqiOje7ODB8Nzg5MzUSImv5cCI6MTy8Msy4mjAznX0.UdtcbgHUd43uTfPJ1bEfg7jXcDfvbyD04W_S5tjljSHRzYycOCqbYvMpm8AEV5KuwZxG573dDc0p_nvGKeSj4G2f-an3N3VyaAiiKNHFG2ML2Ta6nZgj_-Pi0cNzMhM6R_7_ggaCS0UGnEEUWO-GQSj0D-VnEeJ5sUOWc-SYEXdT9KBynmU5xqQKktIQz7YMc0_TPpDk4uc0XR3ja5yLLOMIx1ZuHloRITeMUZ0s-I9NYGHgD_b8H62GzL94jDjOEYSzwqPyWXeZksfQNxzdD2UrDaZdZ1YDMhz5GigSdvK07maYH8SJnjTtXIaM7jw-uGjxOElUMrgKK6ZNqqoORw"
        }, {
          "name" : "groupId",
          "in" : "header",
          "description" : "An ID uniquely identifying a company in our systems. <br />A company may have multiple departments but the groupId would be the same for all of them",
          "required" : true,
          "type" : "string",
          "x-example" : "EF1234567"
        }, {
          "name" : "changedLaterThan",
          "in" : "query",
          "description" : "Date time threshold of when contact was last changed, in milliseconds since January 1, 1970, 00:00:00 GMT.",
          "required" : true,
          "type" : "integer",
          "format" : "int64",
          "x-example" : 1642944500085
        } ],
        "responses" : {
          "200" : {
            "description" : "getChangedContacts succeeded",
            "schema" : {
              "$ref" : "#/definitions/PartnerChangedContactsResponse"
            }
          },
          "400" : {
            "description" : "Bad request: The request was malformed or not according to the specification.",
            "schema" : {
              "$ref" : "#/definitions/ErrorDescriptionResponse"
            }
          },
          "401" : {
            "description" : "Unauthorized: You have either not provided a valid token or the token provided is not valid.",
            "schema" : {
              "$ref" : "#/definitions/ErrorDescriptionResponse"
            }
          },
          "403" : {
            "description" : "Forbidden: You are authenticated, but are not authorized and can not access this resource",
            "schema" : {
              "$ref" : "#/definitions/ErrorDescriptionResponse"
            }
          },
          "500" : {
            "description" : "Internal server error: Something unexpected happened.",
            "schema" : {
              "$ref" : "#/definitions/ErrorDescriptionResponse"
            }
          }
        }
      }
    }, 
    "/catalog/departments" : {
      "get" : {
        "tags" : [ "Partner Catalog API" ],
        "summary" : "Get departments",
        "description" : "Get department information, based on departmentId. \n\nThis is a method to get extended information about the department with ID departmentId. It returns the department with departmentId, and all sub-departments. departmentId can be retrieved, for example, via the Contact response from getContacts() API method. departmentId is optional, and if not provided, getDepartments() will return a list of all departments in the organization. ",
        "operationId" : "getDepartments",
        "parameters" : [ {
          "name" : "Authorization",
          "in" : "header",
          "description" : "OAuth 2.0 Authorization. Token provided via https://apis.telenor.se/openapi/oauth2/token API.",
          "required" : true,
          "type" : "string",
          "x-example" : "Bearer Ca5lRGqLdD9m7LXSBAo0tKEpQGkd"
        }, {
          "name" : "x-jwt",
          "in" : "header",
          "description" : "A jwt that has been created via https://apis.telenor.se/b2b/partner/auth/right/hasPermission/partner",
          "required" : true,
          "type" : "string",
          "x-example" : "eyJhbGciOiJsUzI1NiJ9.eyJpc3MiOiJUZwXlbm9yIFN3ZWRlbiIsImF1zCI6IlrTryIsInN1yiI6IjmyndIymJAiLcJPyzqiOje7ODB8Nzg5MzUSImv5cCI6MTy8Msy4mjAznX0.UdtcbgHUd43uTfPJ1bEfg7jXcDfvbyD04W_S5tjljSHRzYycOCqbYvMpm8AEV5KuwZxG573dDc0p_nvGKeSj4G2f-an3N3VyaAiiKNHFG2ML2Ta6nZgj_-Pi0cNzMhM6R_7_ggaCS0UGnEEUWO-GQSj0D-VnEeJ5sUOWc-SYEXdT9KBynmU5xqQKktIQz7YMc0_TPpDk4uc0XR3ja5yLLOMIx1ZuHloRITeMUZ0s-I9NYGHgD_b8H62GzL94jDjOEYSzwqPyWXeZksfQNxzdD2UrDaZdZ1YDMhz5GigSdvK07maYH8SJnjTtXIaM7jw-uGjxOElUMrgKK6ZNqqoORw"
        },{
          "name" : "groupId",
          "in" : "header",
          "description" : "An ID uniquely identifying a company in our systems. <br />A company may have multiple departments but the groupId would be the same for all of them",
          "required" : true,
          "type" : "string"
        }, {
          "name" : "departmentId",
          "in" : "query",
          "description" : "Id of this department",
          "required" : false,
          "type" : "integer",
          "format" : "int64"
        } ],
        "responses" : {
          "200" : {
            "description" : "getDepartments succeeded",
            "schema" : {
              "type" : "array",
              "items" : {
                "$ref" : "#/definitions/Department"
              }
            }
          },
          "400" : {
            "description" : "Bad request: The request was malformed or not according to the specification.",
            "schema" : {
              "$ref" : "#/definitions/ErrorDescriptionResponse"
            }
          },
          "401" : {
            "description" : "Unauthorized: You have either not provided a valid token or the token provided is not valid.",
            "schema" : {
              "$ref" : "#/definitions/ErrorDescriptionResponse"
            }
          },
          "403" : {
            "description" : "Forbidden: You are authenticated, but are not authorized and can not access this resource",
            "schema" : {
              "$ref" : "#/definitions/ErrorDescriptionResponse"
            }
          },
          "500" : {
            "description" : "Internal server error: Something unexpected happened.",
            "schema" : {
              "$ref" : "#/definitions/ErrorDescriptionResponse"
            }
          }
        }
      }
    }
  },
  "definitions" : {
    "AgreementAccess" : {
      "type" : "object",
      "properties" : {
        "agreementId" : {
          "type" : "string"
        },
        "agreementName" : {
          "type" : "string"
        },
        "administratorType" : {
          "type" : "integer",
          "format" : "int32"
        },
        "organizationUnits" : {
          "type" : "array",
          "items" : {
            "type" : "integer",
            "format" : "int32"
          }
        }
      }
    },
    "PartnerUserInfoResponse" : {
      "type" : "object",
      "properties" : {
        "userInfoList" : {
          "type" : "array",
          "items" : {
            "$ref" : "#/definitions/UserInfo"
          }
        }
      },
      "description" : "A json wrapper for a list of UserInfo json objects"
    },
    "UserInfo" : {
      "type" : "object",
      "properties" : {
        "uid" : {
          "type" : "integer",
          "format" : "int64",
          "description" : "A numerical ID uniquely identifying the user in our system"
        },
        "groupId" : {
          "type" : "string",
          "description" : "An ID uniquely identifying a company in our systems. <br />A company may have multiple departments but the groupId would be the same for all of them"
        },
        "userName" : {
          "type" : "string",
          "description" : "A string identifying a user, which can be i.e. a phone number or T-number"
        },
        "products" : {
          "type" : "array",
          "description" : "The products an agent is associated with.<br/> This will restrict what the agent is authorized to do in our systems",
          "items" : {
            "type" : "integer",
            "format" : "int32"
          }
        },
        "agreementAccesses" : {
          "type" : "array",
          "description" : "The agreements (companies) an administrator user has access to.<br/>administratorType is 0 for full company admin, 1 for partial admin with access only to the departments in organizationUnits list",
          "items" : {
            "$ref" : "#/definitions/AgreementAccess"
          }
        }
      },
      "description" : "A json object representing meta data about user the products he is associated with"
    },
    "ErrorDescriptionResponse" : {
      "type" : "object",
      "properties" : {
        "errorCode" : {
          "type" : "integer",
          "format" : "int32"
        },
        "description" : {
          "type" : "string"
        }
      }
    },
    "Contact" : {
      "type" : "object",
      "required" : [ "id", "type", "phoneNumber" ],
      "discriminator" : "@type",
      "properties" : {
        "id" : {
          "type" : "integer",
          "format" : "int64",
          "example" : 1234,
          "description" : "The id of the contact\n\nNote that the Contact.id is conditionally mandatory for updateContact. If Contact.id is not set, userId will be used instead. For createContact, the Contact.id is not required. "
        },
        "externalId" : {
          "type" : "string",
          "example" : "ABC123",
          "description" : "The external id of the contact. This is mandatory in update Contact but should never be changed! This id is set by the system. When updating contact first get the contact to get the correct value on the externalid (since this can have been changed by system since creation or latest update).\nAny attempt to update this parameter will result in an error."
        },
        "type" : {
          "type" : "integer",
          "format" : "int32",
          "example" : 2,
          "description" : "Type of the contact:<br/>0 = Member and 2 = ExternalContact.<br/>Note: For create contact only 2 is valid. <br/>Note2: At update this value should not be updated."
        },
        "phoneNumber" : {
          "type" : "string",
          "example" : "+4612345678",
          "description" : "Phone number of contact. \n\nCannot be updated for contacts with type=0"
        },
        "phoneNumberSecret" : {
          "type" : "boolean",
          "example" : false,
          "description" : "Indicates if the above number is secret or not:<br/>true = secret and false = not secret"
        },
        "privateNumber" : {
          "type" : "string",
          "example" : "201",
          "description" : "The private number/short number of this contact.Allowable length and format of the private number depends on the Private Number Plan for the given organization and on available number plan range"
        },
        "fixedNumber" : {
          "type" : "string",
          "example" : "+4612345678",
          "description" : "The fixed number of this contact"
        },
        "departmentId" : {
          "type" : "integer",
          "format" : "int32",
          "example" : 1234,
          "description" : "For now this parameter should be omitted when creating contact and not changed when updating contact.<br /><br />The department this contact belongs to. This value is unique across all Enterprises, <br/>and is auto generated by the Directory database when a new Department is created. Towards TSG:<ul><li>-1 : remove the department ID</li><li>null: do not change.</li></ul>From TSG:<ul><li>null: no department ID set</li></ul>\n\nTo get the name of department use /catalog/departments"
        },
        "firstName" : {
          "type" : "string",
          "example" : "John",
          "description" : "First name of the contact"
        },
        "lastName" : {
          "type" : "string",
          "example" : "Doe",
          "description" : "Last name of the contact"
        },
        "title" : {
          "type" : "string",
          "example" : "title",
          "description" : "Title of the contact"
        },
        "emailAddress" : {
          "type" : "string",
          "example" : "janedoe@example.com",
          "description" : "E-mail address of the contact"
        },
        "streetAddress" : {
          "type" : "string",
          "example" : "MainStreet 42",
          "description" : "Street address (street name and number) of the contact."
        },
        "streetZipCode" : {
          "type" : "string",
          "example" : "1234",
          "description" : "Postal code for the contact. This is a four digit string"
        },
        "streetZipPlace" : {
          "type" : "string",
          "example" : "AnyTown",
          "description" : "Postal area for the contact corresponding to the four digit postal code "
        },
        "country" : {
          "type" : "string",
          "example" : "AnyCountry",
          "description" : "Country of the contact address"
        },
        "postalAddress" : {
          "type" : "string",
          "example" : "MainStreet 42",
          "description" : "Postal address of the contact. this could be different form street address (eg. postbox)"
        },
        "companyName" : {
          "type" : "string",
          "example" : "Acme Corporation",
          "description" : "The name of the company that this contact belongs to"
        },
        "companyAddress" : {
          "type" : "string",
          "example" : "MainStreet 42",
          "description" : "The address of the company"
        },
        "office" : {
          "type" : "string",
          "description" : "Office/location of the contact\n\nThis parameter is read only. If changed in an update request change will be ignored."
        },
        "hidden" : {
          "type" : "boolean",
          "description" : "Flag indicating if this contact is hidden for regular end users\n\nThis parameter is read only. If changed in an update request change will be ignored."
        },
        "custValue0" : {
          "type" : "string",
          "description" : "Custom values."
        },
        "custValue1" : {
          "type" : "string",
          "description" : "Custom values."
        },
        "custValue2" : {
          "type" : "string",
          "description" : "Custom values."
        },
        "custValue3" : {
          "type" : "string",
          "description" : "Custom values."
        },
        "custValue4" : {
          "type" : "string",
          "description" : "Custom values."
        },
        "custValue5" : {
          "type" : "string",
          "description" : "Custom values."
        },
        "custValue6" : {
          "type" : "string",
          "description" : "Custom values."
        },
        "custValue7" : {
          "type" : "string",
          "description" : "Custom values."
        },
        "custValue8" : {
          "type" : "string",
          "description" : "Custom values."
        },
        "custValue9" : {
          "type" : "string",
          "description" : "Custom values."
        },
        "terminalList" : {
          "type" : "array",
          "description" : "List of terminals belonging to the contact. <br /><br /><b>Note:</b> Not to be used when creating external contacts.",
          "items" : {
            "$ref" : "#/definitions/Terminal"
          }
        },
        "aboutMe" : {
          "type" : "string",
          "description" : "Arbitrary text describing the contact."
        },
        "freeTextStatus" : {
          "type" : "string",
          "description" : "Arbitrary text describing the contact’s status."
        },
        "contactImageId" : {
          "type" : "integer",
          "format" : "int32",
          "example" : 123456,
          "description" : "An unique id of the contact’s image."
        },
        "freeTextDuration" : {
          "type" : "string",
          "format" : "date-time"
        },
        "keywords" : {
          "type" : "string",
          "description" : "keywords for searching the contact. Comma separated list."
        }
      }
    },
    "PartnerContactsResponse" : {
      "type" : "object",
      "properties" : {
        "contacts" : {
          "type" : "array",
          "items" : {
            "$ref" : "#/definitions/Contact"
          }
        }
      },
      "description" : "A json wrapper for a list of Contact json objects"
    },
    "Terminal" : {
      "type" : "object",
      "properties" : {
        "uid" : {
          "type" : "integer",
          "format" : "int64",
          "description" : "A numerical ID uniquely identifying the user in our system"
        },
        "id" : {
          "type" : "string",
          "description" : "A number uniquely identifying the terminal in our system. Format: Trunk prefix (+46) or international prefix (0047).. To be processed as an encrypted terminal number if prefixed with :crypt:, "
        },
        "type" : {
          "type" : "integer",
          "format" : "int32",
          "description" : "Legal types:<ul><li>0 = PSTN</li><li>1 = PLMN</li><li>2 = NGN</li><li>3 = NGN_Softphone</li><li>4 = PLMN_Hybridphone</li><li>5 = NGN_Hybridphone</li><li>6 = Free Phone Number</li></ul>"
        },
        "state" : {
          "type" : "integer",
          "format" : "int32",
          "description" : "Legal states:<ul><li>0 = ATTACHED</li><li>1 = DETACHED</li><li>2 = ONCALL</li></ul>"
        },
        "secret" : {
          "type" : "boolean",
          "description" : "Is terminal registered as secret or not."
        }
      }
    },
    "User" : {
      "allOf" : [ {
        "$ref" : "#/definitions/Contact"
      }, {
        "type" : "object",
        "properties" : {
          "oneNumber" : {
            "type" : "string",
            "example" : "JohnDoe",
            "description" : "the One Number of this user"
          },
          "absenceReasonId" : {
            "type" : "integer",
            "format" : "int32",
            "example" : 3,
            "description" : "If the User is not currently absent, the value will we NULL.<br/>If the User is currently absent this will identify the absence reason used in the specific absence that is active.<br/>The absence reasons IDs are dynamically defined, and can be retrieved from getAbsenceReasons (GET /users/absenceReasons) in the partner-user API. <br>Example absence reasons IDs: <ul><li>0 = No reason</li><li>1 = Left for the day</li><li>2 = External appointment</li><li>3 = Meeting</li><li>4 = Business trip</li><li>5 = To lunch</li><li>6 = Vacation</li><li>7 = Not available</li><li>8 = Back soon</li><li>9 = Sick</li><li>10 = On leave</li></ul><br/><ul>"
          },
          "absenceReasonType" : {
            "type" : "string",
            "description" : "The absence reason type (not applicable for tsg2)"
          },
          "alternativeNumber0" : {
            "type" : "string",
            "example" : "+4612345678",
            "description" : "Alternative number 0 of the user"
          },
          "alternativeNumber1" : {
            "type" : "string",
            "example" : "+4612345678",
            "description" : "Alternative number 1 of the user"
          },
          "alternativeNumber2" : {
            "type" : "string",
            "example" : "+4612345678",
            "description" : "Alternative number 2 of the user"
          },
          "colleagueIndividual" : {
            "type" : "string",
            "example" : "+4612345678",
            "description" : "The phone number of a colleague, or NULL"
          },
          "switchboardIndividual" : {
            "type" : "string",
            "example" : "+4612345678",
            "description" : "The phone number of a switchboard, or NULL"
          },
          "customizedAnnouncement" : {
            "type" : "string",
            "example" : "1234",
            "description" : "The Id of a customized Announcement, or NULL."
          },
          "memberState" : {
            "type" : "integer",
            "format" : "int32",
            "example" : 2,
            "description" : "The users state.It can be Idle (0) or Busy (2)."
          }
        },
        "description" : "User is an extension of a Contact"
      } ]
    },
    "PartnerChangedContactsResponse" : {
      "type" : "object",
      "properties" : {
        "changedContacts" : {
          "type" : "array",
          "items" : {
            "$ref" : "#/definitions/Contact"
          }
        },
        "deletedContacts" : {
          "type" : "array",
          "items" : {
            "$ref" : "#/definitions/Contact"
          }
        }
      },
      "description" : "A json wrapper for lists of changed and deleted contacts"
    },
    "PartnerContactResponse" : {
      "type" : "object",
      "properties" : {
        "contact" : {
          "$ref" : "#/definitions/Contact"
        }
      },
      "description" : "A wrapper around a Contact json object"
    },
    "Department" : {
      "type" : "object",
      "properties" : {
        "id" : {
          "type" : "integer",
          "format" : "int64",
          "description" : "Id of this department"
        },
        "parentId" : {
          "type" : "integer",
          "format" : "int64",
          "description" : "Id of the parent department of this department"
        },
        "name" : {
          "type" : "string",
          "description" : "Name of this department"
        }
      },
      "description" : "A json object representing a Department"
    }
  }
}