Method: PlayStationNetworkAPI::Trophy#trophy_groups

Defined in:
lib/play_station_network_api/trophy.rb

#trophy_groups(communication_id) ⇒ Object

communication_id [String]



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# File 'lib/play_station_network_api/trophy.rb', line 43

def trophy_groups(communication_id)
  url = if 
    # https://m.np.playstation.net/api/trophy/v1/users/6462910331343535058/npCommunicationIds/NPWR00133_00/trophyGroups?npServiceName=trophy
    [path, 'npCommunicationIds', communication_id, 'trophyGroups']
  else
    # https://m.np.playstation.net/api/trophy/v1/npCommunicationIds/NPWR00133_00/trophyGroups?npServiceName=trophy
    [path(communication_id), 'trophyGroups']
  end

  get(url.join('/'),
    query: {
      npServiceName: 'trophy'
    }
  ).parsed_response
end