For a deeper look into our DataScope Select SOAP API, look into:

Overview |  Quickstart |  Documentation |  Downloads |  Tutorials

question

Upvotes
Accepted
28 1 1 7

DSS REST API python sample of user preferences change

Does any python or postman code available to change DSS user preferences?

dss-rest-apidatascope-selectdss
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvote
Accepted
9.5k 10 5 7

Hello @kazuhisa.matsuda

User preferences change example can be found in C# Example Application. Apart from C# source code, the application also shows HTTP requests and responses in HTTP tab.

The application demonstrates how to change PartialEmbargoedReportsEnabled user preference in Update User Preferences under User Examples section.

The first step is to get all user preferences. My PartialEmbargoedReportsEnabled user preference is true like example below:

The next step is to update the preferences using PUT method. The body is all user preferences got from the first step with the changed preference. In this example, it sets PartialEmbargoedReportsEnabled to be false. Then, you should receive the successful response, 204 HTTP response code.

Hope this help.


icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
28 1 1 7

I could get user preference.getpreference.jpg but got error to put(update) the preference. setpreference.jpg.. What am I missing??


getpreference.jpg (123.4 KiB)
setpreference.jpg (98.1 KiB)
icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
11.3k 25 8 13

Hi @kazuhisa.matsuda,

Can you try the json parameter in requests.put() method instead of data parameter? For more information, please see this guide.

requests.put(Url, json=body, headers=requestHeaders)

Normally, the reason of status 400 (bad request) will be provided in the response body. You can also add the following code to get more information from response body.

res = requests.put(....) 
print(res.text)

If the issue still persist, please share the body of status 400.

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Upvotes
28 1 1 7

works! thank you..

icon clock
10 |1500

Up to 2 attachments (including images) can be used with a maximum of 5.0 MiB each and 10.0 MiB total.

Click below to post an Idea Post Idea