Business API: sharing_info object not returned for in /files/list_folder - dropbox

I'm trying to retrieve "share information" of a file that is contained inside user folder in a team space.
Basically, sharing a file using links from the user folder, I would like to understand if a file has been shared or not.
The folder containing the file shared is not shared itself.
The documentation states that:
The access rights of the content is returned within the sharing_info of the file metadata.
[...]
The absence of sharing_info on a file or folder indicates that it is unshared content, accessible only by the user.
I used the followin API to retrieve user file and folder list:
curl -X POST \
https://api.dropboxapi.com/2/files/list_folder \
-H 'Authorization: Bearer <token>' \
-H 'Content-Type: application/json' \
-H 'Dropbox-API-Select-User: <user-id>' \
-d '{"path": "","recursive": true,"include_media_info": false,"include_deleted": false,"include_has_explicit_shared_members": true,"include_mounted_folders": true, "limit":2000}'
The response do not contain sharing_info but inside dropbox the sharing settings are set to link with access to anyone (see picture)
There is any way to understand, using the files/list_folder API, if a file has been shared using a link? If not, which API should I use to discern this case? Thanks

Unfortunately there isn't a way to retrieve shared links along with the file listing. The sharing_info there is only for the the shared folder kind of sharing, not shared links. I'll pass this along as a feature request. I can't promise if or when that might be implemented though.
Instead, if you want to retrieve shared links for any particular item, you should use /2/sharing/list_shared_links.

Related

GitHub API Access denied trying to update a workflow via API

I created a public repository within my personal account, created a PAT w/ the workflow permissions checked, but am unable to disable the workflow via the API as I receive a message stating that I must have admin rights to the repository. I believe the PAT has the correct permissions so I’m unsure as to why this isn’t working.
Here is the command I am attempting to use (based on the documentation):
curl -s christronyxyocum:MY-PAT -X PUT -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/MY-USERNAME/MY-REPO/actions/workflows/workflow.yml/disable
I can retrieve information about the workflow without any issues so I believe that I have the correct URL and formatting, etc. I have even tried creating a new PAT with the same permissions and that one experiences the same error.
I have figured this out. Rather than using the username:token format like they show repeatedly in their documentation, you must use the -H "Authorization: bearer TOKEN" header with the curl command.

How to import an Environment in Matillion

I am new to Matilion (Even Matillion is a new tool). I am able to export an existing environment into a JSON file using REST API.
But I observed that there is no REST API endpoint for importing an environment. Rather there is an option for updating an existing environment.
Any help/pointers will be appreciated.
Matillion REST API reference link : https://redshift-support.matillion.com/s/article/2920263
Regards,
Neeraj
I got the solution. No need to specify the environment name in API URL. It will automatically pick the name from JSON file. Below is an example.
curl -X POST -u <user_name>:<password> http://<Matillion Instance IP>/rest/v1/group/name/icm/project/name/<>/environment/import -H "Content-Type: application/json" --data-binary "<path to exported JSON file>"

Login as a user in parse-server without having his password useing the master key?

It's possible to "simulate" a user using the master key? I would like this feature to test what the user can really see in the application and verify that he does not have access to some part of it etc.
Is this possible without knowing the password of the user?
If you want to test how user, roles, and permissions work, a simple way to do it is to make command line REST requests against the parse-server. Here's the guide.
You should be able to go into your parse dashboard and locate a user, look at their session token and then use that in queries to simulate that user's permissions.
With a session token, you can query objects in parse like this:
$ curl \
-X GET \
-H 'X-Parse-Application-Id: ABC123 \
-H "X-Parse-Session-Token: r:XXXXXX" \
-H "Content-Type: application/json" \
https://cloud.so.good/parse/classes/Product
For a complex system, you'll want to cover your cloud code to ensure that all is working as expected. A good place to start would be with parse-server's extensive test coverage, including ACL's
You can create a Parse.Session object for the particular user, setting the user and expiresAt fields. You creating the object, get the sessionToken key from the object.
Then for any request you are trying to make, you will set the X-Parse-Session-Token header to be the value of the session token.

Active Collab send Email after User create

I'am using the Active Collab API V5 to create User from our Service Desk - the creation of the User with the following POST works.
curl -k -v -h "Content-Type:application/json" -h "X-Angie-AuthApiToken:XXXXXXX" -X POST -d '{"type": "Member","email": "XXXXXXXX#XXXXXX", "password": "XXXXX"}' https://URL/api/v1/users
Is it possible to send the invite link automatically? Like the User creation on the web interface (Send invite link from People page).
I found this API Reference https://developers.activecollab.com/api-documentation/v1/people/users/invite.html but on this way its only possible to invite directly to projects.
System makes a distinction between account creation, and invitiation (which includes account creation, but does a bit more). Here's how to invite one user or more users:
curl -h "Content-Type:application/json" \
-h "X-Angie-AuthApiToken:XXXXXXX" \
-X POST -d '{"role": "Member","email_addresses": ["X#Y.COM", "Y#X.com"], "custom_permissions": ["can_manage_projects", "can_manage_finances"]}' \
https://URL/api/v1/users/invite
Differences:
API end-point is different (/api/v1/users/invite),
Use role instead of type,
A list of more than one email address can be specified,
Custom permissions can be set,
You can't specify user's password. They will receive invitation email, and complete the process themselves.

Create an ajax call

i've never used an ajax call,can anybody suggest me to create a jquery ajax call using this api (parse.com),what is H,G?:
curl -X GET \
-H "X-Parse-Application-Id: qS0KLMx5h9lFLGJIpj9qyhM9EEPiTS3VMk" \
-H "X-Parse-REST-API-Key: nh3eoUo9GF2gMhcKJIfIt1Gm" \
-G \
--data-urlencode 'username=cooldude6' \
--data-urlencode 'password=p_n7!-e8' \
https://api.parse.com/1/login
curl is a tool for sending HTTP requests. The -H flag sets a header and -G specifies that the data should be transmitted as a URL query parameter rather than content body. In this case, your command sends an HTTP GET command with the custom headers "X-Parse-Application-Id" and "X-Parse-REST-API-Key". This request was sent to https://api.parse.com/1/login?username=cooldude6&password=p_n7!-e8.
You don't need to become a CURL expert to use Parse; the REST API helps you understand how the Parse API works across the wire, but there are both first and third party APIs for just about every language you would need.
P.S. The Parse docs page helps you by pre-filling the value of X-Parse-Application-Id and X-Parse-REST-API-Key with keys from your actual app. By posting these keys online, others can write code that will look like your app to Parse. Though best practices would suggest you secure your app so that it's OK for these keys to leak (e.g. by setting class-level permissions), you may consider deleting & recreating a new app since it sounds like you are just starting development.