API documentation

All API-methods (except login) requires a "token" in header of the request. This token is given the user when submitting a valid login request.

Authentication

Name Type Url Parameters Description
Login POST /api/login
  • username
  • password
If valid login credentials, returns a usertoken that is needed for all other API-methods
Logout POST /api/logout Deletes the login token used for this request

Reset password

Name Type Url Parameters Description
Create password change request POST /api/password/reset
  • email
Sends an email with a link containing a code to set a new password
Set new password PUT /api/password/new
  • userId
  • code
  • newPassword
  • confirmNewPassword
Sets the new password if userId and code is correct. Also checks that newPassword and confirmNewPassword are identical

Brand

Name Type Url UserLevel Parameters Description
Get all GET /api/brand/all All Fetch all brands the current user has access to
Get my brands GET /api/brand/my All
  • activeBrandId
Fetch all brands (BrandMiniDto) the current user has access to and current brand in a BranFullDto.
Get by ID GET /api/brand/{Brand_id} All Fetch a brand if the current user has access
Create POST /api/brand Admin
  • object.name
  • object.logo
  • object.fbAccountId
  • object.fbPixelId
  • object.afAdvertiserId
  • object.liAccountId
  • object.orderNotificationEmail (only if user is system admin)
  • object.manualOrderNotificationEmail (only if user is system admin)
  • object.budgetAllocationOptionString (only if user is system admin - Valid values: "BUDGET_OPTION_ONLY, CUSTOM")
  • adPlatformTypes
  • wordPreferences.brand
  • wordPreferences.brands
  • wordPreferences.company
  • wordPreferences.companies
  • wordPreferences.campaignType
  • wordPreferences.campaignTypes
  • wordPreferences.campaign
  • wordPreferences.campaigns
  • wordPreferences.landingPage
  • liTargetingEntities[i].
    • name
    • urn
  • fbTargetingEntities[i].
    • name
    • key
    • type
Creates a brand with the given paramenters. Field adPlatformTypes is a list of valid AdPlatformTypes. All wordPreferences are optional, and will get default values if not set
Update PUT /api/brand/{Brand_id} Brandadmin for given brand
  • object.name
  • object.logo
  • object.fbAccountId
  • object.fbPixelId
  • object.afAdvertiserId
  • object.liAccountId
  • object.orderNotificationEmail (only if user is system admin)
  • object.manualOrderNotificationEmail (only if user is system admin)
  • object.budgetAllocationOptionString (only if user is system admin - Valid values: BUDGET_OPTION_ONLY, CUSTOM)
  • adPlatformTypes
  • wordPreferences.brand
  • wordPreferences.brands
  • wordPreferences.company
  • wordPreferences.companies
  • wordPreferences.campaignType
  • wordPreferences.campaignTypes
  • wordPreferences.campaign
  • wordPreferences.campaigns
  • wordPreferences.landingPage
  • liTargetingEntities[i].
    • id (only if existing)
    • name
    • urn
  • fbTargetingEntities[i].
    • id (only if existing)
    • name
    • key
    • type
Updates a brand with the given paramenters. Field adPlatformTypes is a list of valid AdPlatformTypes. All wordPreferences are optional, and will get default values if not set

LinkedIn

Name Type Url UserLevel Parameters Description
Fetch LinkedIn location facets GET /api/linkedin-location-search Company admin
  • searchword
Fetch LinkedIn location facets based on search word (Norway only)

Google Places

Name Type Url UserLevel Parameters Description
Fetch location from Google Places GET /api/google-places-search User
  • searchword
Fetch location from Google Places based on search word
Fetch location from Google Places GET /api/google-address-by-coordinates User
  • lat
  • lng
Fetch addresses from Google Geocode based on coordinates (reverse geocoding)

Facebook

Name Type Url UserLevel Parameters Description
Fetch Facebook targeting facets GET /api/facebook-targeting-search Company admin
  • query
  • type (adgeolocation, country, region, city, zip)
Fetch Facebook targeting facets based on search query and type

Company

Name Type Url UserLevel Parameters Description
Get by ID GET /api/company/{Company_id} All Fetch a company if the current user has access
Create POST /api/company Brand admin for the brand this company will be conected to
  • object.brand.id
  • object.name
  • object.url
  • object.fbPageId
  • object.logo
  • object.lat
  • object.lng
  • object.radius
  • object.supportsRelativeUrl
  • liOrganizationId
  • geoLocations[i].
    • name
    • lat
    • lng
    • radius
  • liTargetingEntities[i].
    • name
    • urn
  • fbTargetingEntities[i].
    • name
    • key
    • type
Creates a company with the given paramenters
Update PUT /api/company/{Company_id} Company admin for the given company
  • object.brand.id
  • object.name
  • object.url
  • object.fbPageId
  • object.logo
  • object.lat
  • object.lng
  • object.radius
  • object.liOrganizationId
  • object.supportsRelativeUrl
  • geoLocations[i].
    • id (only for existing)
    • name
    • lat
    • lng
    • radius
  • liTargetingEntities[i].
    • id (only if existing)
    • name
    • urn
  • fbTargetingEntities[i].
    • id (only if existing)
    • name
    • key
    • type
Updates a company with the given paramenters
Delete DELETE /api/company/{Brand_id} Brand admin for given company or higher Deactivates a company with the given id

Targeting Group

Name Type Url UserLevel Parameters Description
Get parent targeting group GET /api/targeting-group/parent/{parentId} Brand admin Fetches a targeting group based on ID. User must be brand admin with the associated brand, or company. Returns: targetingGroup
Get targeting group by parent and company GET /api/targeting-group/parent/{parentId}/company/{companyId} Brand admin Fetches a targeting group based on parent ID and company ID. User must be brand admin with the associated brand, or company. Returns: targetingGroup (if exists), parentTargetingGroup
Create parent targeting group (For Brand) POST /api/targeting-group Admin
  • brandId
  • object.name
  • object.selectedAfSettingsGroup.id
  • geoLocations[i].
    • name
    • lat
    • lng
    • radius
    • address
  • liTargetingEntities[i].
    • name
    • urn
  • afLocationIds (list)
  • scMetroIds (list)
  • scRegionIds (list)
Creates a Targeting group for the given brand
Update parent targeting group (For Brand) PUT /api/targeting-group/parent/{id} Brand Admin
  • object.name
  • object.selectedAfSettingsGroup.id
  • geoLocations[i].
    • id (only for existing)
    • name
    • lat
    • lng
    • radius
    • address
  • liTargetingEntities[i].
    • id (only if existing)
    • name
    • urn
  • afLocationIds (list)
  • scMetroIds (list)
  • scRegionIds (list)
Creates or updates a Targeting group for the given company with the parent given
Create or update targeting group for company PUT /api/targeting-group/parent/{parentId}/company/{companyId} Brand Admin
  • object.name
  • object.selectedAfSettingsGroup.id
  • geoLocations[i].
    • id (only for existing)
    • name
    • lat
    • lng
    • radius
    • address
  • liTargetingEntities[i].
    • id (only if existing)
    • name
    • urn
  • afLocationIds (list)
  • scMetroIds (list)
  • scRegionIds (list)
Creates or updates a Targeting group for the given company with the parent given

User Access Invite

Name Type Url UserLevel Parameters Description
Get token invite GET /api/user-access-invite/{token} All Fetches the user access invite with given token. Will give error if the token has an email associated with a user is already (should then redirect to login)
Register user POST /api/user-access-invite/{token} All
  • name
  • password (at least 8 characters)
  • acceptMarketingEmails
Creates a new User from the invitation token. Uses invite token to fetch the invite. The email should be automatically filled from the token.
Cancel access invite DELETE /api/user-access-invite/{id} User with at least the authority to create a similar invite Deletes the user access invite with given id
Respond to access invite POST /api/user-access-invite/respond Only the user associated with the invite
  • tokens
  • accept
Responds to the user access invite. Accept is set to true for accepting and false for declining.
Invite user to brand POST /api/user-access-invite/inviteToBrand Rights equal or higher that the invited user
  • email
  • userType
    • Valid values:
    • BRANDADMIN
  • brandId
Invites a user to the given brand. If the user already has access or a pending invitation with the same or higher access level this will fail. If success; responds with full brand.
Invite user to company POST /api/user-access-invite/inviteToCompany Rights equal or higher that the invited user
  • email
  • userType
    • Valid values:
    • COMPANYADMIN
    • COMPANYUSER
  • companyId
Invites a user to the given company. If the user already has access or a pending invitation with the same or higher access level this will fail. If success; responds with full company.

User Access

Name Type Url UserLevel Parameters Description
Delete access DELETE /api/user-access/{id} All Will remove access between company/brand and a user, as long as user has admin access and power equal to or above the targeted access.

User

Name Type Url UserLevel Parameters Description
Get self GET /api/user/me All Fetches the user that is logged in
Update self PUT /api/user/me All
  • name
  • acceptMarketingEmails
  • budgetAllocationOption
Updates the user that is logged in
Update my password POST /api/user/me/password All
  • oldPassword
  • newPassword
Updates the password for the user that is logged in
Get all GET /api/user/all Admin Fetches all users (only for testing purposes)
The correct way to fetch users are via fetchBrand and fetchCompany (only users of brandadmin or above can see users on fetchBrand)
Get by ID GET /api/user/{User_id} Companyuser: fetch self,
CompanyAdmin: fetch users of that company,
BrandAdmin: fetch users of that brand
Admin: fetch any user
Fetches the user with given ID
Accept user invite (create user) POST /api/user/new/{token} All
  • token
  • object.name
  • object.password (at least 8 characters)
Creates a new User. Uses token to fetch the invite. The email should be automatically filled from the token.
Update PUT /api/user/{User_id} Update self: all,
Update others: only systemadmin
  • object.name
  • object.password (at least 8 characters, don't include to not change password)
  • object.billingReference (only if editing user is systemadmin)
Updates an existing User

DefaultCampaignTypeSize

Name Type Url UserLevel Parameters Description
Get all GET /api/default-campaign-type-size/all All Fetch all DefaultCampaignTypeSize

CampaignType

Name Type Url UserLevel Parameters Description
Get all GET /api/campaign-type/all Admin Fetch all CampaignTypes
Get by ID GET /api/campaign-type/{CampaignType_id} Admin Fetch one CampaignType by ID
Create POST /api/campaign-type Admin
  • object.brand.id
  • object.name
  • object.reference
  • object.fbCtaButton
  • object.fbHeadline
  • object.fbDescription
  • object.fbPrimaryText
  • object.landingPage
  • object.acceptCustomLandingPage
  • object.orderable
  • object.liTitle
  • object.liCommentary
  • object.preview
  • object.targetingGroups.id (accepts multiple)
  • object.liCtaButton
    • Valid values:
    • APPLY
    • DOWNLOAD
    • VIEW_QUOTE
    • LEARN_MORE
    • SIGN_UP
    • SUBSCRIBE
    • REGISTER
    • JOIN
    • ATTEND
    • REQUEST_DEMO
  • object.landingPageType
    • Valid values:
    • ABSOLUTE_URL
    • RELATIVE_URL
    • RELATIVE_URL_PROVIDED
    • CUSTOM_URL
  • campaignFields[0..n]
    • .title
    • .reference
    • .description
    • .required
    • .fieldType (valid values: FREETEXT, SELECT, PICTURE, VIDEO, MODEL)
    • .options[0..n] (only if fieldType is SELECT)
      • .name
      • .value
      • .position
    • .position
    • .maxLength
    • .selectedModel.id (only if fieldType is MODEL)
    • .maxAmount (only if fieldType is MODEL, 0 means unlimited)
  • adPlatformTypes
  • campaignTypeSizeIds
Creates a new CampaignType. Field adPlatformTypes is a list of valid AdPlatformTypes
Update PUT /api/campaign-type/{CampaignType_id} Admin
  • object.brand.id
  • object.name
  • object.reference
  • object.fbCtaButton
  • object.fbHeadline
  • object.fbDescription
  • object.fbPrimaryText
  • object.landingPage
  • object.acceptCustomLandingPage
  • object.orderable
  • object.liTitle
  • object.liCommentary
  • object.preview
  • object.targetingGroups.id (accepts multiple)
  • object.liCtaButton
    • Valid values:
    • APPLY
    • DOWNLOAD
    • VIEW_QUOTE
    • LEARN_MORE
    • SIGN_UP
    • SUBSCRIBE
    • REGISTER
    • JOIN
    • ATTEND
    • REQUEST_DEMO
  • object.landingPageType
    • Valid values:
    • ABSOLUTE_URL
    • RELATIVE_URL
    • CUSTOM_URL
  • campaignFields[0..n]
    • .id (only for existing fields!)
    • .title
    • .reference
    • .description
    • .required
    • .fieldType (valid values: FREETEXT, SELECT, PICTURE, VIDEO, MODEL)
    • .options[0..n] (only if fieldType is SELECT)
      • .id (only for existing fields!)
      • .name
      • .value
      • .position
    • .position
    • .maxLength
    • .selectedModel.id (only if fieldType is MODEL)
    • .maxAmount (only if fieldType is MODEL, 0 means unlimited)
  • adPlatformTypes
  • campaignTypeSizeIds
Updates an existing CampaignType. Field adPlatformTypes is a list of valid AdPlatformTypes
Change position PUT /api/campaign-type/{CampaignType_id}/move Admin
  • position
Sets position of CampaignType and moves siblings accordingly
Delete CampaignType DELETE /api/campaign-type/{CampaignType_id} Admin Deletes CampaignType

CampaignFieldModelEntry

Name Type Url UserLevel Parameters Description
Create POST /api/campaign-field-model-entry All
  • campaignFieldModelId
  • object.name
  • values[0..n]
    • .reference
    • .type(valid values: FREETEXT, SELECT, PICTURE, VIDEO, MODEL)
    • .text
    • .picture.id (only if campaignField is type PICTURE)
    • .video.id (only if campaignField is type VIDEO)
    • .audio.id (only if campaignField is type AUDIO)
Creates a new CampaignFieldModelEntry for a CampaignFieldModel with the given id campaignFieldModelId.
Update PUT /api/campaign-field-model-entry/{CampaignFieldModelEntry_id} All
  • object.name
  • values[0..n]
    • .id (only for existing fields!)
    • .reference
    • .type(valid values: FREETEXT, SELECT, PICTURE, VIDEO, MODEL)
    • .text
    • .picture.id (only if campaignField is type PICTURE)
    • .video.id (only if campaignField is type VIDEO)
    • .audio.id (only if campaignField is type AUDIO)
Updates an existing CampaignFieldModelEntry.
Delete DELETE /api/campaign-field-model-entry/{CampaignFieldModelEntry_id} All Deletes an existing CampaignFieldModelEntry

CampaignOrder

Name Type Url UserLevel Parameters Description
Create POST /api/campaign-order CompanyUser for given company
  • object.company.id
  • object.campaignType.id
  • object.startDate
  • object.endDate
  • object.landingPage
  • campaignFieldValues[0..n]
    • .reference
    • .type(valid values: FREETEXT, SELECT, PICTURE, VIDEO, MODEL)
    • .text
    • .picture.id (only if campaignField is type PICTURE)
    • .video.id (only if campaignField is type VIDEO)
    • .audio.id (only if campaignField is type AUDIO)
    • .model.selectedEntries[0..*].campaignFieldModelEntry.id
    • .model.selectedEntries[0..*].position
  • budgetOptionId(budgetOption or budgetOptionCustom)
  • customBudget (budgetOptionCustom or fullCustom) - Replaces object.budget
  • customAdPlatformTypes (fullCustom) - List with these possibilities: FACEBOOK, ADFORM, LINKEDIN, SNAPCHAT)
Creates a new CampaignOrder. A CampaignOders budgets can be divided into three different types: budgetOption, budgetOptionCustom, fullCustom
Create multiple POST /api/campaign-orders At least CompanyUser for all companies
  • objects[0..n]
    • .company.id
    • .campaignType.id
    • .startDate
    • .endDate
    • .fieldValues[0..n]
      • .reference
      • .text
      • .fieldType
      • .picture.id (only if campaignField is type PICTURE)
      • .video.id (only if campaignField is type VIDEO)
      • .audio.id (only if campaignField is type AUDIO)
      • .model.selectedEntries[0..*] (NOT YET SUPPORTED)
        • .campaignFieldModelEntry.id
        • .campaignFieldModelEntry.position
    • .manualOrderText
    • .budget
  • budgetOptionId(budgetOption or budgetOptionCustom)
  • customBudget (budgetOptionCustom or fullCustom) - Replaces object.budget
  • customBudgetName (fullCustom)
  • customAdPlatformTypes (fullCustom) - List with these possibilities: FACEBOOK, ADFORM, LINKEDIN, SNAPCHAT)
  • fbCtaButton
  • fbHeadline
  • fbDescription
  • fbPrimaryText
  • scBrandName
  • scHeadline
  • scCtaButton
  • liTitle
  • liDescription
  • liCommentary
  • liCtaButton
Creates one or several campaignOrders
Update PUT /api/campaign-order/{CampaignOrder_id} CompanyUser for given company
  • object.startDate
  • object.endDate
  • object.landingPage
  • campaignFieldValues[0..n]
    • .id (only for existing fields!)
    • .reference
    • .type(valid values: FREETEXT, SELECT, PICTURE, VIDEO, MODEL)
    • .text
    • .picture.id (only if campaignField is type PICTURE)
    • .video.id (only if campaignField is type VIDEO)
    • .audio.id (only if campaignField is type AUDIO)
    • .model.selectedEntries[0..*].id (only for existing selectedEntries)
    • .model.selectedEntries[0..*].campaignFieldModelEntry.id(only for new selectedEntries)
    • .model.selectedEntries[0..*].position
  • budgetOptionId (hvis ikke full custom order)
  • customBudget (erstatter object.budget)
  • customAdPlatformTypes (kun hvis full custom, liste med følgende muligheter: FACEBOOK, ADFORM, LINKEDIN, SNAPCHAT)
  • fbCtaButton
  • fbHeadline
  • fbDescription
  • fbPrimaryText
  • scBrandName
  • scHeadline
  • scCtaButton
  • liTitle
  • liDescription
  • liCommentary
  • liCtaButton
Updates an existing CampaignOrder.
Cancel PUT /api/campaign-order/{CampaignOrder_id}/cancel CompanyUser for given company Cancels CampaignOrder (either a running one, or a pending one)
Get one campaign order (no login required) GET /api/campaign-order/{CampaignOrder_id}/ad None Used when rendering an ad. Only requires a valid campaignOrderId. Returns a much simpler version with only the needed data for rendering an ad.
Get campaign orders by brand GET /api/campaign-order/by-brand/{Brand_id} CompanyUser for at least one company under given brand Fetches all CampaignOrders for the given brand
Get campaign order with report GET /api/campaign-order/{CampaignOrder_id} CompanyUser for given company Fetches a full CampaignOrder including report data from ad platforms for the given campaign order.
Fetch billable orders GET /api/campaign-order/billable Admin Fetches billable campaignorders.
Billing POST /api/campaign-order/{CampaignOrder_id}/bill Admin Marks the given CampaignOrder as billed.

CampaignFieldPicture

Name Type Url UserLevel Parameters Description
Upload POST /api/campaign-field-picture Any user
  • qqfile (max 10MB)
  • object.jsonProperties
Uploads a temp file that can be used in a campaignOrder as a CampaignFieldOption
Update PUT /api/campaign-field-picture/{id} Any user
  • object.jsonProperties
Updates properties for a picture

CampaignFieldVideo

Name Type Url UserLevel Parameters Description
Upload POST /api/campaign-field-video Any user
  • qqfile (max 200MB)
  • object.jsonProperties
Uploads a temp file that can be used in a campaignOrder as a CampaignFieldOption
Update PUT /api/campaign-field-video/{id} Any user
  • object.jsonProperties
Updates properties for a video

CampaignFieldAudio

Name Type Url UserLevel Parameters Description
Upload POST /api/campaign-field-audio Any user
  • qqfile (max 10MB)
  • object.jsonProperties
Uploads a temp file that can be used in a campaignOrder as a CampaignFieldOption
Update PUT /api/campaign-field-audio/{id} Any user
  • object.jsonProperties
Updates properties for an audio

CSV importer

Name Type Url UserLevel Parameters Description
Start import POST /api/import/run Admin
  • file
  • brandId
Starts importing companies for the given brandId using the submitted CSV-file
Get log GET /api/import/log Admin Get log for last import job

Configuration

Name Type Url UserLevel Parameters Description
Get configuration GET /api/conf System admin Get the current configurations. What is to be running, and what is paused
Update configuration PUT /api/conf System admin
  • configuration.running
  • configuration.restartRunning
  • configuration.sendEmails
  • configuration.createAssets
  • configuration.createCampaigns
  • configuration.createReports
  • configuration.fetchHistoricStats
  • configuration.linkedInFullLogging
Updates configuration with the given values