Community Conundrum 25:Feature Visualization is now live! Read More

how to create project using public API

Level 3
how to create project using public API

any example on how to create project using REST API , referred https://doc.dataiku.com/dss/api/7.0/rest/ 

 

tried to access API it works but when i tried to use /public/api/projects/get-summary?projectKey=A getting 

 

HTTP ERROR 405

Problem accessing /dip/publicapi/projects/get-summary. Reason:

    Request method 'GET' not supported
0 Kudos
6 Replies
Dataiker
Dataiker

Hi,

Please note that for ease of use, we strongly recommmend using our Python client (https://doc.dataiku.com/dss/latest/python-api/) rather than manually interacting with the REST API. The Python client makes it much easier to interact with the API.

In order to create a project with the REST API, you need to POST on /public/api/projects/. There is no "get-summary" endpoint in the REST API.

Your POST body should be JSON and contain the following keys at a minimum: projectKey, name and owner

Here is a sample:

 

 

curl -X POST -u YOUR_API_KEY_HERE: http://YOUR_DSS_HOST:YOUR_DSS_PORT/public/api/projects/ -H "Content-Type: application/json" --data '{"projectKey": "MYNEWPROJECT", "name": "My new very nice project", "owner": "admin"}'

 

 

0 Kudos
Level 3
Author

Hi @Clément_Stenac ,

 

thank you do you have reference link or example on how to create project ? Using python client ?

0 Kudos
Level 3
Author

Hi @Clément_Stenac ,

thank you for the details, do we have any examples on how to use client?

 

i was referring this https://doc.dataiku.com/dss/latest/python-api/rest-api-client/client.html

 

is this correct way to do it?

 

client = dataiku.api_client()
client.create_project("cezF9Ycuh", "ABCTEST", "name", description=None, settings=None, project_folder_id=None)

 

also i am seeing below error python back end service is not starting, is there any way to start it?

 

6-26-2020 9-19-16 AM.png

0 Kudos
Dataiker
Dataiker

Hi,

Yes this is the correct way to do it.

 

Since your Python issue is unrelated, please make sure to open another topic. Please keep each discussion on a single topic.

0 Kudos
Level 3
Author

Sure thank you ! will check and update you @Clément_Stenac 

0 Kudos
Level 3
Author

Hi @Clément_Stenac ,

perfect thanks, its works, so is there any recommendation to use

project_key (str) – the identifier to use for the project. Must be globally unique?

how to generate this key any default charsets/ number of characters limits etc?

 

 

0 Kudos