ZendeskApi.Tickets.CreateTicket throws 401 despite "Anybody can submit tickets" is enabled - zendesk

I have a Trial subscription and I'm using ZendeskApi.Tickets.CreateTicket(ticket) to create a new ticket; Anybody can submit tickets is Enabled. It works when I create a ticket with requester.email that is a registered user, but I'm getting the below error when I try to create a ticket with a Requester who is not a user. Tips on what I'm doing wrong?
The remote server returned an error: (401) Unauthorized.Error content: {"error":"Couldn't authenticate you"}
Resource String: tickets.json +
Body: {
"ticket": {
"subject": "Subject",
"comment": {
"body": "Message test body",
"public": false
},
"requester": {
"email": "wendellj#gmail.com"
},
"is_public": false
}

For anonymous user you should use this api end point: https://developer.zendesk.com/rest_api/docs/core/requests#create-request
This is used to create requests in zendesk when user is not registered with user and it doesn't need authentication header as well. See
To make anonymous requests:
Omit the authorization header.
Include a requester object in the request object.

Related

Microsoft Graph API: 400 when using "invite" endpoint

I want to send an invitation by mail to customers, so they can download a file from our SharePoint. The request is like this:
https://graph.microsoft.com/v1.0/sites/{{siteId}}/drives/{{driveId}}/root:/Prueba/prueba.txt:/microsoft.graph.invite
With body:
{
"recipients": [
{"email": "mail1#mail.com"},
{"email": "mail2#mail.com"}
],
"message": "Download your file",
"requireSignIn": true,
"sendInvitation": true,
"roles": [ "read" ]
}
If I fill up "recipients" with mails from the organization, everything goes ok.
But when I use external mails (gmail, hotmail, other companies mails, etc), the response is 400 with this body:
{
"error": {
"code": "invalidRequest",
"message": "The request is malformed or incorrect.",
}
}
}
I suppose we need to configure our SharePoint in a certain way, but Microsoft support couldn't help us. Could anyone suggest any solution?
Thanks!
You can use the other mail Accounts like gmail,yahoo etc in the recipients property but before that you need to modify your site setting. Go to Sharepoint Admin Center--> Sites --> Active Sites --> Select the site which you are using and click on the 3 dots just below "Active sites" heading and select sharing and make it anyone.

No HTTP resource was found that matches the request URI 'https://outlook.office365.com:444/profile/v1.0/users

I'm using Microsoft Graph to create a new user in my Azure AD. I'm using Graph Explorer to do so, I'm doing a POST request to https://graph.microsoft.com/v1.0/users with the following son in the body:
{
"accountEnabled": true,
"displayName": "displayName-value",
"mailNickname": "mailNickname-value",
"userPrincipalName": "upn-value#tenant-value.onmicrosoft.com",
"passwordProfile" : {
"forceChangePasswordNextSignIn": true,
"password": "password-value"
}
}
I keep getting the error: 'No HTTP resource was found that matches the request URI https://outlook.office365.com:444/profile/v1.0/users..'
I dont find anything about this error in google, why is this about? Why is the request URI 'https:/outlook.office35.com:444..' if I'm making the request to 'https://graph.microsoft.com..'?
You can't create "users" with an MSA, each account is a single user. You also cannot create a user in an AAD tenant without User.ReadWrite.All or Directory.ReadWrite.All permissions. Both of these will require consent from a tenant administrator.

Unable to send email message on behalf of another O365 outlook account

For some reason the 'Send on Behalf' feature is failing for me. Graph always returns an ErrorSendAsDenied (when From and Sender field values are different).
The accounts are verified to have the correct configuration for sending on behalf of each other. I couldn't make it work after spending more than three days on it.
Following permissions are requested during authentication:
openid
email
profile
offline_access
User.Read
Mail.Read
Mail.ReadWrite
Mail.Read.Shared
Mail.ReadWrite.Shared
Mail.Send
Mail.Send.Shared
For the example below, the user Gregory Test wants to send messages on behalf of Sem Test. A valid authorization access token (authenticated by Gregory Test) is used for sending the email, however email delivery ALWAYS fails.
The sample submitted JSON message is:
{
"Message":{
"Subject":"Trying to send message on behalf",
"Body":{
"ContentType":"html",
"Content":" email html content "
},
"From":{
"EmailAddress":{
"Address":"sem.test#contoso.com",
"Name":"Sem Test"
}
},
"Sender":{
"EmailAddress":{
"Address":"gregory.test#contoso.com",
"Name":"Gregory Test"
}
},
"ToRecipients":[
{
"EmailAddress":{
"Address":"semtestestestes#gmail.com",
"Name":"Sem Shehovtsov"
}
}
]
}
}
If the Sender and From are set to the same value, it is working fine. The Sender mailbox is configured to allow sending messages on behalf of other users.
Any ideas?
You don't need to set the Sender property, Graph will handle this automatically for you. From the documentation:
In order to send from another user, set the from property on the message sent to the email address of the user to send from. You don't need to set the sender property - Microsoft Graph will set it appropriately, based on the mailbox permissions granted to the user who has signed in.
Try this payload instead:
{
"message":{
"subject": "Trying to send message on behalf",
"body":{
"contentType":"html",
"content":" email html content "
},
"toRecipients":[
{
"emailAddress":{
"address":"semtestestestes#gmail.com",
"name":"Sem Shehovtsov"
}
}
],
"from":{
"emailAddress":{
"address":"sem.test#contoso.com",
"name":"Sem Test"
}
},
}
}
Also, you don't need to request both Read and ReadWrite scopes. The ReadWrite scopes overlap with the Read scopes.

Authentication fails on google home (oauth2)

I'm trying to connect to google home using OAuth2.0 mechanism. However, hitting with an issue where I'm not able to retrieve success message.
The failing request is - https://oauthintegrations.googleapis.com/v1/token:getForService
with the response payload as redirectState. I know about redirect but what is redirectState? I tried to search a bit over this one, but failed.
Any help would be appreciated.
Note:I have followed all the necessary steps mentioned in doc, I can receive authorisation code, but not able to make token request to desired endpoint.
The docs are https://developers.google.com/actions/identity/oauth2-code-flow and https://developers.google.com/actions/identity/account-linking.
In configuration settings we have Linking type as Oauth -> Authorization Code.
In dialog flow in Integration -> Integration Settings we have checked in for 'Sign in required' for Default Welcome Intent and have the firebase function as
app.intent('Default Welcome Intent', (conv) => {
conv.ask(new SignIn());
});
according to https://developers.google.com/actions/identity/account-linking document and I am currently using API version V2.
After the auth code is received as mentioned it does not call token url, we receive this screen :
Bad response from IdP in Auth Code Exchange & what is redirect_state
The https://gala-demo.appspot.com/app#redirect_state=XXX&state=yyy&service=abc when inspected fails at https://oauthintegrations.googleapis.com/v1/token:getForService as mentioned by #rajesh with status code 400, but when this request is made through postman it return the response. Here is the body and response for the request.
Body :
{
"credential" : {
"redirectState": "XXX"
},
"scopes": [],
"gdiState": "APP_AUTH",
"serviceId": "tapclicks-integration-adac2_dev"
}
RESPONSE :
{
"serviceInfo": {
"authUrl": "https://-domain-/authorization",
"name": "tapclicks dashboard",
"logoUrl": "https://placeholder.com/",
"clientId": "zdqexVMaVvxIMQ7Frjwa",
"tokenUrl": "https://-domian-/token_url",
"privacyPolicyUrl": "https://placeholder.com/",
"tosUrl": "https://placeholder.com/",
"id": "tapclicks-integration-adac2_dev"
},
"completionInfo": {
"appauthInfo": {
"appauthRedirectUrl": "https://-domain-/authorization?response_type=code&client_id=zdqexVMaVvxIMQ7Frjwa&redirect_uri=https://oauth-redirect.googleusercontent.com/r/tapclicks-integration-adac2&scope=gmail&state=yyy",
"appauthRedirectState": "abcxxx"
},
"oauthAuthorizationUrl": "https://-domain-/authorization?response_type=code&client_id=zdqexVMaVvxIMQ7Frjwa&redirect_uri=https://oauth-redirect.googleusercontent.com/r/tapclicks-integration-adac2&scope=gmail&state=yyy"
},
"gdiState": "APP_AUTH",
"header": {}
}
Can you please tell if i might be making any configuration mistake or any other info you need.
Authorization Url : https://kprb95tye7.execute-api.us-east-1.amazonaws.com/authorization/
Token Url : https://9343j46f16.execute-api.us-east-1.amazonaws.com/token_url/
Thanks

Jira Api Error when creating issue

On my website I have a contact form which when submitted, creates a new service desk ticket. It makes the following rest api call:
https://jira-housters.atlassian.net/rest/servicedeskapi/request (with appropriate Accept and Authorization request headers)
{
"serviceDeskId": "1",
"requestTypeId": "1",
"requestFieldValues": {
"summary": "Housters Contact from Justin Test (Web)",
"description": "test message"
},
"raiseOnBehalfOf": "myemail#mydomain.com"
}
Before this worked completely fine, however a few days ago it started erroring:
{"errorMessage":"Your request could not be created. Please check the fields have been correctly filled in. Please provide a valid value for field 'Raise this request on behalf of'","i18nErrorMessage":{"i18nKey":"sd.validation.request.creation.failure.required.field","parameters":["Please provide a valid value for field 'Raise this request on behalf of'"]}}
This makes no sense, as it's complaining about the raise request on behalf of field when I clearly have it specified. What gives?
raiseOnBehalfOf should have the customers accountId not email.
You can create a customer using:-
-> https://your-domain.atlassian.net/rest/servicedeskapi/customer
-> Get the accountId from the response.

Resources