Skip to content

Latest commit

 

History

History
170 lines (116 loc) · 5.15 KB

File metadata and controls

170 lines (116 loc) · 5.15 KB

FlatApi.UserApi

All URIs are relative to https://api.flat.io/v2

Method HTTP request Description
gerUserLikes GET /users/{user}/likes List liked scores
getUser GET /users/{user} Get a public user profile
getUserScores GET /users/{user}/scores List user's scores

gerUserLikes

[ScoreDetails] gerUserLikes(user, opts)

List liked scores

Example

var FlatApi = require('flat-api');
var defaultClient = FlatApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: OAuth2
var OAuth2 = defaultClient.authentications['OAuth2'];
OAuth2.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new FlatApi.UserApi();

var user = "user_example"; // String | Unique identifier of a Flat user. If you authenticated, you can use `me` to refer to the current user. 

var opts = { 
  'ids': true // Boolean | Return only the identifiers of the scores
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.gerUserLikes(user, opts, callback);

Parameters

Name Type Description Notes
user String Unique identifier of a Flat user. If you authenticated, you can use `me` to refer to the current user.
ids Boolean Return only the identifiers of the scores [optional]

Return type

[ScoreDetails]

Authorization

OAuth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

getUser

UserPublic getUser(user)

Get a public user profile

Get a public profile of a Flat User.

Example

var FlatApi = require('flat-api');
var defaultClient = FlatApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: OAuth2
var OAuth2 = defaultClient.authentications['OAuth2'];
OAuth2.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new FlatApi.UserApi();

var user = "user_example"; // String | This route parameter is the unique identifier of the user. You can specify an email instead of an unique identifier. If you are executing this request authenticated, you can use `me` as a value instead of the current User unique identifier to work on the current authenticated user. 


var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.getUser(user, callback);

Parameters

Name Type Description Notes
user String This route parameter is the unique identifier of the user. You can specify an email instead of an unique identifier. If you are executing this request authenticated, you can use `me` as a value instead of the current User unique identifier to work on the current authenticated user.

Return type

UserPublic

Authorization

OAuth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

getUserScores

[ScoreDetails] getUserScores(user, opts)

List user's scores

Get the list of public scores owned by a User. DEPRECATED: Please note that the current behavior will be deprecrated on 2019-01-01. This method will no longer list private and shared scores, but only public scores of a Flat account. If you want to access to private scores, please use the Collections API instead.

Example

var FlatApi = require('flat-api');
var defaultClient = FlatApi.ApiClient.instance;

// Configure OAuth2 access token for authorization: OAuth2
var OAuth2 = defaultClient.authentications['OAuth2'];
OAuth2.accessToken = 'YOUR ACCESS TOKEN';

var apiInstance = new FlatApi.UserApi();

var user = "user_example"; // String | Unique identifier of a Flat user. If you authenticated, you can use `me` to refer to the current user. 

var opts = { 
  'parent': "parent_example" // String | Filter the score forked from the score id `parent`
};

var callback = function(error, data, response) {
  if (error) {
    console.error(error);
  } else {
    console.log('API called successfully. Returned data: ' + data);
  }
};
apiInstance.getUserScores(user, opts, callback);

Parameters

Name Type Description Notes
user String Unique identifier of a Flat user. If you authenticated, you can use `me` to refer to the current user.
parent String Filter the score forked from the score id `parent` [optional]

Return type

[ScoreDetails]

Authorization

OAuth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json