Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

create explicit group fails #86

Open
veustp opened this issue Feb 15, 2021 · 1 comment
Open

create explicit group fails #86

veustp opened this issue Feb 15, 2021 · 1 comment
Assignees
Labels
pkg:api api related activities prio:asap Fix as soon as possible status:confirmed Is a valid issue and will be moved forward soon. type:bug Something isn't working

Comments

@veustp
Copy link

veustp commented Feb 15, 2021

using
Windows 64bit
pydataverse 0.3.0
python 3.7.9
dataverse v. 4.20 build 413-4e07b62

This works:
Api call using requests module to create an explicit group in the (existing) "testdv" dataverse:
import json
import requests
gdata = {
"description":"req desc",
"displayName":"req dname",
"aliasInOwner":"reqalias"
}
json_gdata = json.dumps(gdata)
headers = {'X-Dataverse-key':,'Content-Type':'application/json'}
r = requests.post(baseUrl+'/api/dataverses/testdv/groups', headers=headers, data=json_gdata)

This - using the pydataverse module- for doing the same thing does not:
from pyDataverse.api import NativeApi, Api
import json
gdata = {
"description":"pdv desc",
"displayName":"pdv dname",
"aliasInOwner":"pdvalias"
}
json_gdata = json.dumps(gdata)
api2 = Api(baseUrl, apiKey)
resp = api2.post_request(baseUrl+"/api/dataverses/testdv/groups",json_gdata)
RESPONSE: HTTP code 415
The code suggests that the payload data is not in the correct format.
It is currently being passed as a json string.

The same has also been tried using the NativeApi class with the same response (415 http code).

The post_request call did already work when testing to POST metadatablocks for a given dataverse.

Creating a group from the command line using curl did also succeed.

Maybe I'm doing something wrong here but I can't really put my finger on it - any help or confirmation on this issue is much appreciated.

@veustp veustp added status:incoming Newly created issue to be forwarded type:bug Something isn't working labels Feb 15, 2021
@skasberger skasberger self-assigned this Feb 15, 2021
@skasberger skasberger added pkg:api api related activities prio:asap Fix as soon as possible status:confirmed Is a valid issue and will be moved forward soon. and removed status:incoming Newly created issue to be forwarded labels Feb 15, 2021
@skasberger skasberger added this to the v0.4.0 milestone Feb 15, 2021
@skasberger skasberger mentioned this issue Mar 14, 2021
35 tasks
@pdurbin
Copy link
Member

pdurbin commented Feb 14, 2024

As discussed during the 2024-02-14 meeting of the pyDataverse working group, we are closing old milestones in favor of a new project board at https://github.com/orgs/gdcc/projects/1 and removing issues (like this one) from those old milestones. Please feel free to join the working group! You can find us at https://py.gdcc.io and https://dataverse.zulipchat.com/#narrow/stream/377090-python

@pdurbin pdurbin removed this from the v0.4.0 milestone Feb 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pkg:api api related activities prio:asap Fix as soon as possible status:confirmed Is a valid issue and will be moved forward soon. type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants