gdcc / pyDataverse

Python module for Dataverse Software (dataverse.org).
http://pydataverse.readthedocs.io/
MIT License
63 stars 41 forks source link

Collect all API endpoint and their response, depending on the interaction #133

Open skasberger opened 3 years ago

skasberger commented 3 years ago

Collect all API endpoints, and their response (status code and message), depending on the passed parameters.

Requirements

ACTIONS

0. Pre-Requisites

1. Research

2. Plan

API when api endpoint available, it works with and without v1/ f"{BASE_URL}/api/" endpoint not available f"{BASE_URL}/api/v1" endpoint not available f"{BASE_URL}/api/info" endpoint not available f"{BASE_URL}/api/v1/info" endpoint not available f"{BASE_URL}/api/info/metrics" endpoint not available f"{BASE_URL}/api/v1/info/metrics" endpoint not available

http://localhost:8085/api/
{'status': 'ERROR', 'code': 404, 'message': "'/api/v1/' endpoint does not exist on this server. Please check your code for typos, or consult our API guide at http://guides.dataverse.org."}

http://localhost:8085/api/v1/
{'status': 'ERROR', 'code': 404, 'message': "'/api/v1/' endpoint does not exist on this server. Please check your code for typos, or consult our API guide at http://guides.dataverse.org."}

http://localhost:8085/api/dataverses/1
{'status': 'OK', 'data': {'id': 1, 'alias': 'root', 'name': 'Root', 'dataverseContacts': [{'displayOrder': 0, 'contactEmail': 'root@mailinator.com'}], 'permissionRoot': True, 'description': 'The root dataverse.', 'dataverseType': 'UNCATEGORIZED', 'creationDate': '2020-01-07T00:33:54Z'}}

http://localhost:8085/api/v1/dataverses/1
{'status': 'OK', 'data': {'id': 1, 'alias': 'root', 'name': 'Root', 'dataverseContacts': [{'displayOrder': 0, 'contactEmail': 'root@mailinator.com'}], 'permissionRoot': True, 'description': 'The root dataverse.', 'dataverseType': 'UNCATEGORIZED', 'creationDate': '2020-01-07T00:33:54Z'}}

http://localhost:8085/api/info
{'status': 'ERROR', 'code': 404, 'message': "'/api/v1/info' endpoint does not exist on this server. Please check your code for typos, or consult our API guide at http://guides.dataverse.org."}

http://localhost:8085/api/v1/info
{'status': 'ERROR', 'code': 404, 'message': "'/api/v1/info' endpoint does not exist on this server. Please check your code for typos, or consult our API guide at http://guides.dataverse.org."}

http://localhost:8085/api/info/metrics
{'status': 'ERROR', 'code': 404, 'message': "'/api/v1/info/metrics' endpoint does not exist on this server. Please check your code for typos, or consult our API guide at http://guides.dataverse.org."}

http://localhost:8085/api/v1/info/metrics
{'status': 'ERROR', 'code': 404, 'message': "'/api/v1/info/metrics' endpoint does not exist on this server. Please check your code for typos, or consult our API guide at http://guides.dataverse.org."}

http://localhost:8085/api/info/metrics/dataverses
{'status': 'OK', 'data': {'count': 1}}

http://localhost:8085/api/v1/info/metrics/dataverses
{'status': 'OK', 'data': {'count': 1}}

http://localhost:8085/api/search
{'status': 'ERROR', 'message': 'q parameter is missing'}

http://localhost:8085/api/v1/search
{'status': 'ERROR', 'message': 'q parameter is missing'}

http://localhost:8085/api/search?q=aussda
{'status': 'OK', 'data': {'q': 'aussda', 'total_count': 0, 'start': 0, 'spelling_alternatives': {}, 'items': [], 'count_in_response': 0}}

http://localhost:8085/api/v1/search?q=aussda
{'status': 'OK', 'data': {'q': 'aussda', 'total_count': 0, 'start': 0, 'spelling_alternatives': {}, 'items': [], 'count_in_response': 0}}

http://localhost:8085/api/access
{'status': 'ERROR', 'code': 404, 'message': "'/api/v1/access' endpoint does not exist on this server. Please check your code for typos, or consult our API guide at http://guides.dataverse.org."}

http://localhost:8085/api/v1/access
{'status': 'ERROR', 'code': 404, 'message': "'/api/v1/access' endpoint does not exist on this server. Please check your code for typos, or consult our API guide at http://guides.dataverse.org."}

3. Implement

4. Follow Ups

pdurbin commented 4 months ago

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