survos / platform-api-r

Sample programs demonstrating calls to the API
0 stars 0 forks source link

assignments() needs to accept more criteria #4

Open tacman opened 8 years ago

tacman commented 8 years ago

Current assignments() is implemented to accept a jobId as a parameter, but it needs to be much more flexible. It should probably simply map whatever is passed to the API, and this model should be true for other GET calls as well.

For example, we might want

assignments <- assignments(jobId=163,memberId=224,status='unapproved')

The code should not require the fields to be in any specific order. If R doesn't support that, then perhaps we should be passing a list:

assignmentCriteria = list()
assignmentCriteria$jobId = 163
assignmentCriteria$memberId = 224
a <- assignments(assignmentCriteria)

Again, I'm not 100% sure of the best way to do this, but we don't want to have the users have to deal with function calls with a long list of arguments, most of which are optional.

phillc73 commented 8 years ago

From an R point of view, the function options do not need to be in any specific order. You could put "status" first, followed by "memberID" if you wished.

I need to know a couple of things to move forward with this. Using assignments as the example:

phillc73 commented 8 years ago

I'd also like to add that the users{} endpoint supports both POST and DELETE methods, obviously as well as GET.

Can you please supply me with some test data for POST, which I can then also test via DELETE. Or would you just like me to make up data?

I haven't tested, but assuming the previously supplied "nyu" credentials will support POST and DELETE for users{}?

tacman commented 8 years ago

No, the nyu credentials should not support anything for users, only members.