How to use the forge-apis.UserProfileApi function in forge-apis

To help you get started, we’ve selected a few forge-apis examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github DefinitelyTyped / DefinitelyTyped / types / forge-apis / forge-apis-tests.ts View on Github external
// $ExpectType ProjectsApi
const projectsApi = new ProjectsApi();
// $ExpectType Promise
projectsApi.getHubProjects('', {}, authClientTwoLegged, authToken);
// $ExpectType Promise
projectsApi.getProject('', '', authClientTwoLegged, authToken);
// $ExpectType Promise
projectsApi.getProjectHub('', '', authClientTwoLegged, authToken);
// $ExpectType Promise
projectsApi.getProjectTopFolders('', '', authClientTwoLegged, authToken);
// $ExpectType Promise
projectsApi.postStorage('', {}, authClientTwoLegged, authToken);

// $ExpectType UserProfileApi
const userProfileApi = new UserProfileApi();
// $ExpectType Promise
userProfileApi.getUserProfile(authClientTwoLegged, authToken);

// $ExpectType VersionsApi
const versionsApi = new VersionsApi();
// $ExpectType Promise
versionsApi.getVersion('', '', authClientTwoLegged, authToken);
// $ExpectType Promise
versionsApi.getVersionItem('', '', authClientTwoLegged, authToken);
// $ExpectType Promise
versionsApi.getVersionRefs('', '', {}, authClientTwoLegged, authToken);
// $ExpectType Promise
versionsApi.getVersionRelationshipsRefs('', '', {}, authClientTwoLegged, authToken);
// $ExpectType Promise
versionsApi.postVersion('', {}, authClientTwoLegged, authToken);
// $ExpectType Promise
github Autodesk-Forge / bim360appstore-data.management-nodejs-transfer.storage / server / forge / oauth.js View on Github external
router.get('/api/forge/profile', function (req, res) {
  var token = new Credentials(req.session);
  var credentials = token.getForgeCredentials();
  if (credentials === undefined) {
    res.status(401).end();
    return;
  }

  var forge3legged = new forgeSDK.AuthClientThreeLegged(
    config.forge.credentials.client_id,
    config.forge.credentials.client_secret,
    config.forge.callbackURL,
    config.forge.scope,
    true);

  var user = new forgeSDK.UserProfileApi();
  user.getUserProfile(forge3legged, token.getForgeCredentials())
    .then(function (profile) {
      token.setAutodeskId(profile.body.userId);
      // This feature is not GDPR compliant
      //stats.userProfile(profile.body);
      res.json({
        name: profile.body.firstName + ' ' + profile.body.lastName,
        picture: profile.body.profileImages.sizeX40,
        id: profile.body.userId
      });
    })
    .catch(function (error) {
      console.log(error);
      res.status(401).end()
    })
});
github Autodesk-Forge / forge-upgradefiles-revit / routes / user.js View on Github external
router.get('/user/v1/profile', async (req, res) => {
    const oauth = new OAuth(req.session);
    const internalToken = await oauth.getInternalToken();
    const user = new UserProfileApi();
    const profile = await user.getUserProfile(oauth.getClient(), internalToken);
    res.json({
        name: profile.body.firstName + ' ' + profile.body.lastName,
        picture: profile.body.profileImages.sizeX40
    });
});
github Autodesk-Forge / learn.forge.viewhubmodels / routes / user.js View on Github external
router.get('/user/profile', async (req, res) => {
    const oauth = new OAuth(req.session);
    const internalToken = await oauth.getInternalToken();
    const user = new UserProfileApi();
    const profile = await user.getUserProfile(oauth.getClient(), internalToken);
    res.json({
        name: profile.body.firstName + ' ' + profile.body.lastName,
        picture: profile.body.profileImages.sizeX40
    });
});
github Autodesk-Forge / forge.commandline-nodejs / api / other.js View on Github external
.then((oa3Legged) => {
				let oa3Info = new ForgeAPI.UserProfileApi();
				return (oa3Info.getUserProfile(oa3Legged, oa3Legged.credentials));
			})
			.then((profile) => {