PUT ​/api​/v3​/guest_account​/:vid​/preferences

Updates a guest account’s preferences including location, notification preferences, and genres.

Request

Example Request

{
  "preferences": {
    "genre_groups": "",
    "genres": "",
    "genres_excluded": "",
    "promo_push_notification": true,
    "feature_permissions": {
    },
    "share_push_notification": true,
    "friend_request_push_notification": true,
    "friend_also_favorited_push_notification": true,
    "favorite_on_upvote": {
    },
    "location": {
      "id": {
      },
      "preference_id": {
      },
      "lat": 29.7628,
      "lng": -95.3831
    }
  }
}

Example Parameters

  • preferences:

    • Required: no
    • genre_groups: A list of genre groups that the user has selected. If present, genres may not be specified, as they are derived from the selected groups. An array of items should be passed such as ['Rock', 'Metal']. This also accepts a deprecated comma seperated string list such as 'Rock,Metal'.

      • Required: no
      • Type:
        • array
        • string
      • Items

        • Required: no
        • Type: string
        • Example: [ "Rock", "Pop" ]
    • genres: A custom list of genres the user has selected. If present, genre_groups must not be specified. An array of items should be passed such as ['Rock', 'Metal']. This also accepts a deprecated comma seperated string list such as 'Rock,Metal'.

      • Required: no
      • Type:
        • array
        • string
      • Items

        • Required: no
        • Type: string
        • Example: [ "Rock", "Jazz", "Rap" ]
    • genres_excluded: A custom list of excluded genres the user has chosen not to hear. If specified, genre_groups must not be provided. An array of items should be passed such as ['Rock', 'Metal']. This also accepts a deprecated comma seperated string list such as 'Rock,Metal'.

      • Required: no
      • Type:
        • array
        • string
      • Items

        • Required: no
        • Type: string
        • Example: [ "Metal", "Punk", "Country" ]
    • promopushnotification: Indicates the user has opted-in to receive promotional push notifications.

      • Required: no
      • Type: boolean
      • Example: true
    • feature_permissions: The feature permission map (json string). Used to define/keep consistent feature availability, feature experiment buckets etc across devices.

      • Required: no
      • Type: text
      • Example: { "voting": true, "allGenres": "hide" }
    • sharepushnotification: Indicates the user has opted-in to receive push notifications when users share content with them.

      • Required: no
      • Type: boolean
      • Example: true
    • friendrequestpush_notification: Indicates the user has opted-in to receive a push notification when they get a new follower.

      • Required: no
      • Type: boolean
      • Example: true
    • friendalsofavoritedpushnotification: Indicates the user has opted-in to receive a push notification when one of the users they follow also stars an item.

      • Required: no
      • Type: boolean
      • Example: true
    • favoriteonupvote: Indicates if the user has opted to automatically favorite a track when he upvotes a track. A value of "always" indicates that he always wants to favorite the track he upvoted, a value of "never" indicates he doesnt want to automatically favorite the up voted track. A value of null indicates that he wants the system to prompt him for every up vote

      • Required: no
      • Type: String
      • Example: always
    • location: The user's preferred location. Typically set to the user's last searched location.

      • Required: no
      • id:

        • Required: no
        • Type: Integer
        • Example: 1
      • preference_id:

        • Required: no
        • Type: Integer
        • Example: 1
      • lat:

        • Required: yes
        • Type: number
        • Example: 29.7628
      • lng:

        • Required: yes
        • Type: number
        • Example: -95.3831

Response

Example Response

{
  "preferences": {
    "id": {
    },
    "genres": [
      null
    ],
    "genre_groups": [
      null
    ],
    "genres_excluded": [
      null
    ],
    "promo_push_notification": false,
    "feature_permissions": {
    },
    "friend_also_favorited_push_notification": false,
    "friend_request_push_notification": false,
    "share_push_notification": false,
    "favorite_on_upvote": {
    },
    "location": {
      "id": {
      },
      "preference_id": {
      },
      "city_station_id": {
      },
      "city": {
      },
      "province": {
      },
      "country": {
      },
      "lat": {
      },
      "lng": {
      }
    },
    "saved_locations": null
  }
}

Response Parameters

  • preferences:

    • Required: no
    • id:

      • Required: yes
      • Type: Integer
      • Example: 1
    • genres: The user's selected genres. This is the custom genre list or the computed genre list based on the selected genre_groups.

      • Required: no
      • Type: array
      • Example: [ "Rock", "Jazz", "Indie", "Blues" ]
    • genre_groups: The user's selected genre groups. If the user has selected their own genres, this will be set to "Custom".

      • Required: no
      • Type: array
      • Example: [ "Rock" ]
    • genres_excluded: The user's excluded genres. This is the custom exclusion list or a computed exclusion list based on the provided genre_groups.

      • Required: no
      • Type: array
      • Example: [ "Metal" ]
    • promopushnotification:

      • Required: no
      • Type: boolean
    • feature_permissions: The feature permission map (json string). Used to define/keep consistent feature availability, feature experiment buckets etc across devices.

      • Required: no
      • Type: text
      • Example: { "voting": true, "allGenres": "hide" }
    • friendalsofavoritedpushnotification:

      • Required: no
      • Type: boolean
    • friendrequestpush_notification:

      • Required: no
      • Type: boolean
    • sharepushnotification:

      • Required: no
      • Type: boolean
    • favoriteonupvote:

      • Required: no
      • Type: String
    • location: The user's preferred location.

      • Required: no
      • id:

        • Required: yes
        • Type: Integer
        • Example: 1
      • preference_id:

        • Required: yes
        • Type: Integer
        • Example: 2
      • citystationid: The official station id for the city corresponding to the location

        • Required: yes
        • Type: Integer
        • Example: 23
      • city:

        • Required: no
        • Type: String
        • Example: Houston
      • province:

        • Required: no
        • Type: String
        • Example: TX
      • country:

        • Required: no
        • Type: String
        • Example: US
      • lat:

        • Required: no
        • Type: Number
        • Example: 29.7628
      • lng:

        • Required: no
        • Type: Number
        • Example: -95.3831
    • saved_locations: The user's saved locations.

      • Required: no
      • Type:
        • null
        • array
      • Items

        • Required: no
        • id:

          • Required: yes
          • Type: Integer
          • Example: 1
        • preference_id:

          • Required: yes
          • Type: Integer
          • Example: 2
        • citystationid: The official station id for the city corresponding to the location

          • Required: yes
          • Type: Integer
          • Example: 23
        • city:

          • Required: yes
          • Type: String
          • Example: Houston
        • province:

          • Required: yes
          • Type: String
          • Example: TX
        • country:

          • Required: yes
          • Type: String
          • Example: US
        • lat:

          • Required: yes
          • Type: Number
          • Example: 29.7628
        • lng:

          • Required: yes
          • Type: Number
          • Example: -95.3831

Response Codes

Successful Response Codes

  • 200: Preferences were updated successfully

Failure Response Codes

  • 422: A bad request