How can i connect user with a connection by using Guacamole REST API - guacamole

I want to connect user with a connection, but Guacamole does not currently have an API documentation.
Is there a way to do that with Guacamole REST API?

I found a solution,
Firstly i created a token
Endpoint:
POST {{baseURL}}/api/tokens
x-www-form-urlencoded:
username: guacadmin
password: guacadmin
Sample Response:
{
"authToken": "8144B9B1EBAF73E8EDCE08EF5C145F49C1C9F563F13E21BF7A1CEC43E74011A4",
"username": "guacadmin",
"dataSource": "postgresql",
"availableDataSources": [
"postgresql",
"postgresql-shared"
]
}
Then i send a PATCH request using json-patch:
Endpoint:
PATCH {{baseURL}}/api/session/data/{{dataSource}}/users/{{username}}/permissions?token={{authToken}}
Sample Request Body:
[
{
"op":"add",
"path": "/connectionPermissions/2",
"value": "READ"
}
]
That's it.

Related

Send email for Graph Api works in Postman but not through App in Azure?

I am accessing the Graph Api endpoint:
https://graph.microsoft.com/v1.0/me/sendMail
I retrieve the access token from Graph Explorer and use it as a Bearer token in Postman.
I also set Content-Type in the header to "application/json".
I set the Body as
{
"message": {
"subject": "Meet for lunch?",
"body": {
"contentType": "Text",
"content": "The new cafeteria is open."
},
"toRecipients": [
{
"emailAddress": {
"address": "testuser#acme.com"
}
}
]
}
}
Through Graph Explorer I have given consent for Mail.Send
It works fine in Postman. I set the scope in my c# app as Mail.Send, but when i send the request it gives the error
{StatusCode: 403, ReasonPhrase: 'Forbidden'
What other permission do i need to set ?

Microsoft Graph API - Invite endpoint returning Bad request every time

I'm trying to share SharePoint directory so specific user invite the invite API endpoint from Microsoft Graph : https://learn.microsoft.com/en-us/graph/api/driveitem-invite
Every time I do the request, I'm receiving a "400 - Bad request" response.
Here is my request:
https://graph.microsoft.com/v1.0/sites/***/drives/***/items/***/invite
Here is the payload:
{
"requireSignIn": true,
"sendInvitation": false,
"roles": [
"read"
],
"recipients": [
{
"email": "***#***.***"
}
]
}
It used to work perfectly.

Xero API fetch list of organization (all organization)

I have done OAuth2.0 using PKCE flow in .NET Framework (C# Winforms).
Now I have tokens_response in my hand.
But I'm wondering is it possible to fetch all of the organisation (not only one)?
You can check the organisations (tenants) that you can access with a given token using the /connections endpoint, like this:
GET https://api.xero.com/connections
Authorization: "Bearer " + access_token
Content-Type: application/json
Response:
[
{
"id": "e1eede29-f875-4a5d-8470-17f6a29a88b1",
"authEventId": "d99ecdfe-391d-43d2-b834-17636ba90e8d",
"tenantId": "70784a63-d24b-46a9-a4db-0e70a274b056",
"tenantType": "ORGANISATION",
"tenantName": "Maple Florist",
"createdDateUtc": "2019-07-09T23:40:30.1833130",
"updatedDateUtc": "2020-05-15T01:35:13.8491980"
},
{
"id": "32587c85-a9b3-4306-ac30-b416e8f2c841",
"authEventId": "d0ddcf81-f942-4f4d-b3c7-f98045204db4",
"tenantId": "e0da6937-de07-4a14-adee-37abfac298ce",
"tenantType": "ORGANISATION",
"tenantName": "Adam Demo Company (NZ)",
"createdDateUtc": "2020-03-23T02:24:22.2328510",
"updatedDateUtc": "2020-05-13T09:43:40.7689720"
}
]
If you need more information than the organisations' id and name, you'll need to call the /organisation endpoint individually for each.
The connections endpoint is described more in section 5 on this page of the docs: https://developer.xero.com/documentation/oauth2/auth-flow

Attempting to create an issue with JIRA REST API results in a 500 error

For automation purposes I'm trying to create issues through the JIRA REST API, but I'm getting a 500, Internal Server Exception as response without any additional information.
With the Chrome-plugin "advance REST client", I ran through the following steps:
Entered the endpoint: h.ttps://[company-jira-url]/rest/api/2/issue/
Set the HTTP method: POST
Added the required headers:
Content-Type: application/json
Authorization: Basic (100% sure this one's correct)
Added the json payload (Basically the minimum required fields):
{
"fields": {
"project":
{
"key": "HACK"
},
"summary": "REST EXAMPLE",
"description": "Creating an issue via REST API",
"issuetype": {
"name": "Bug"
}
}
}
Click "Send"
The request basically looks like this (base64 string is not correct in this example):
The Request
Result:
The Response
Anyone ?

'eventNotification' url is not being called

I am integrating DocuSign with our application. In testing phase we got a server with public IP and port (8086). On this port I have published my asp.net mvc web api and my url becomes:
http://XXX.XXX.XXX.XXX:8086/api/DocuSign/DocuSignDocumentStatus.
This url is going to be called from DocuSign whenever my document status changes.
Our network team has allowed access to following IPs for inbound access to this public IP/URL:
www.docusign.net 209.67.98.12
mailsea.docusign.net 209.67.98.59
NA2
na2.docusign.net 206.25.247.140
mailch.docusign.net 206.25.247.155
EU1
eu1.docusign.net 206.25.247.144
mailch.docusign.net 206.25.247.155
DAL/DR
demo.docusign.net 209.46.117.172
preview.docusign.net 209.46.117.174
mailda.docusign.net 209.46.117.17
I got this from the connect service reference pdf.
Whenever I am uploading the document from signing via docuSign web api and I am also sending this url with the request. I have checked - rechecked many times that my json request being created is correct (pasting it below):
{
"status": "sent",
"emailBlurb": "",
"emailSubject": "DocuSign API - Signature Request on Document Call",
"documents": [
{
"name": "someDocument.xls",
"documentId": "1"
}
],
"recipients": {
"signers": [
{
"recipientId": "1",
"email": "john.doe#someCompany.com",
"name": "John Doe",
"tabs": {
"signHereTabs": [
{
"xPosition": "100",
"yPosition": "100",
"documentId": "1",
"pageNumber": "1"
}
]
},
"routingOrder": "1"
}
],
"carbonCopies": [
{
"recipientId": "2",
"email": "some1.recipient#someCompany.com",
"name": "Some1 Recipient"
},
{
"recipientId": "3",
"email": "some2.recipient#someCompany.com",
"name": "Some2 Recipient"
},
{
"recipientId": "4",
"email": "some3.recipient#someCompany.com",
"name": "Some3 Recipient"
}
]
},
"eventNotification": {
"url": "http://XXX.XXX.XXX.XXX:8086/api/DocuSign/DocuSignDocumentStatus",
"loggingEnabled": true,
"requireAcknowledgement": true,
"includeDocuments": false,
"envelopeEvents": [
{
"envelopeEventStatusCode": "Completed"
},
{
"envelopeEventStatusCode": "Declined"
}
]
}
}
I am able successfully upload the document, emails are being sent successfully to all signers. Document being signed BUT DocuSign for some reason is not able to call my url with the status of the document. Please help. Let me know if you guys need any more information.
As specified by the Answer & subsequent Comment in this other question:
Regardless of whether you're using DocuSign Connect (configured at the account level) or using eventNotification (specified at the Envelope level), DocuSign will only publish messages to the "standard/default" ports:
In the DocuSign demo environment (demo.docusign.net) DocuSign Connect will publish to either port 80 (http) or port 443 (https). If the URL starts with "http", Connect will attempt to publish to port 80. If the URL starts with "https", Connect will attempt to publish to port 443.
In the DocuSign production environment (www.docusign.net), DocuSign Connect will only publish to port 443 (https). Publishing to port 80 (http) is not supported in the production environment -- the listener endpoint must be https.
Therefore, I'd suggest that you remove the port number from the URL that you've specified for "eventNotification", and ensure that your listener endpoint is located at either port 80 (for demo) or port 443 (for demo or prod).

Resources