Skip to content

URL request GET roles of person invalid #1

@Ryuno-Ki

Description

@Ryuno-Ki

Hi,

I was asked by my company to write a web service using the GlassFrog API v3.
I was quite happy to find this library! Currently using 0.6.3 here.

However, I think I found a bug O:

I want to GET the roles of a given person, which has the URL path of https://api.glassfrog.com/api/v3/people/{person_id}/roles according to the linked API documentation.

Looking into the code I see roles?person_id=' + id, i.e. appended the person_id as GET parameter.

I could verify the API doc code works with cURL.

My call:

const GlassFrog = require('glassfrog-js'); // although the docs say, require('glassfrog')
const API_KEY = require('./.env.json').API_KEY;
const glassFrogOptions = { caching: true };
const gf = GlassFrog(API_KEY, glassFrogOptions);

const PERSON_ID = 12345 // actually the value of another call

const handleError = (error) => { return console.error(error); };
const saveAllRolesOfPeople = (response, data) => { return console.log(data); };  // Actually save to disk

gf.get(true).roles().within().people().withID(PERSON_ID).then(saveAllRolesOfPeople).catch(handleError);

The output is undefined. The expected output is something like described in the API documentation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions