Microsoft Teams - Parameters for HTTPPost in webhook - json

I have created a simple incoming webhook for Teams that will send information to a channel when a new high-priority ticket is generated in our ticketing system. I want to add a button to the connector card that will allow a user to directly assign the ticket to themselves from Teams via an HttpPOST request.
I have the button and everything else in place, but I am having trouble determining how, if possible, I can send the user's account ID back to our ticketing system. Our system is connected via LDAP so usernames are the same across both platforms.
Is there general info on what is sent by default with an HttpPOST request? I looked through the Teams connector reference information, but could not find what I was looking for.

You need to include that account id you referred as a parameter in your url or JSON (if you post the it).
Microsoft Teams does not know anything about actions your use will attempt to make.

Related

Simple Esri/ArcGIS Online connection using a link or iframe

I was asked by a potential client if I can have my software interact with Esri/ArcGIS Online.
Use case: users is logged into SomeRandomSoftwareApp and is looking at a Widget, this Widget includes an Esri asset id, the user clicks a link that passes that ID to Esri/ArcGIS Online and behind the scenes the user is logged into Esri and they see the data associated with the Esri/ArcGIS Online.
Thanks, Keith
If I understand correctly, you have two options for this: API Keys or Application Credentials.
The first one, is a permanent token generated by the owner of the data that will allow the application easy access to it. This is still in beta, and it was not ready for use the last time I check some time ago.
The second one, the owner of the data will generate credentials for your application. With this credentials you will have to request a token each time you want to access the data, all this via OAuth 2.0.
Check the docs for more details ArcGIS Services - Security

How to POST to another site with just a url

A service provider is supposed to forward messages on to an endpoint (specified by me) but all I get to give them is a URL. How can I make this work.
I have signed up to a satellite service and I am trying make the first steps with their cloud API. I have hardware which sends simple messages over their satellite infrastructure to their cloud services. The provide the user (me) with a dashboard type interface to register the hardware as well as a desitnation (or multiple destinations) each destination is a single url. I dont get to specify usernames, passwords, code or anything just a single url. The service says
"the data will be forwarded to the pre-registered http(s) endpoint (the URL I have given them). Data is sent as a http POST request with Content-Type: application/json. All data is accompanied by an endpoint reference, timestamp, a unique identifier (UUID), and a digital signature that may be used to verify that the data originated from Myriota. Multiple packets may be batched into a single request."
I have a website so to start with I just want to get a single message to display on my page. I have completed and tested the code to display posts by GETing from https://www.mywebsite.com/wp-json/wp/v2/posts. This works.
the URL that I have given the service provider is the same as above. But none of the data reaches my site.
I dont really know how the data exchange or handshaking works here but I assume that for a third party to post to my site, they would need to include some sort of authentication. can this authentication data be included in the url? what is the authentication data? is it my Wordpress username and password? Is it safe send this data in a url? Can I turn off authentication so that anyone can post to my site? surely that isnt safe?
I have minimal experience with web development but plenty with embedded systems, I am working with a young software engineer and he is stumped also. together we have burned nearly a whole week on this so I have bit the bullet and turned to stackoverflow to see if anyone can help

Service now api how to comment as specific user

I'm working on a project that consumes Service Now API (Rest). To do so our client has registered us as a user in order to login and make all service calls we need to. This project has an interface where users can login once they have an account on Service Now as well, the username they type to log in has nothing to do with service now by the way, but later they associate theirs service now users to it. They can do some operations through this interface, where all of them are done using the integration user/pass not their service now users theirselves, even because they do not need to share their passwords with us. But it's needed to track the correct user to register on service now and I'm in trouble specifically about commenting on an incident. The endpoint to comment is the following :
http://hostname/api/now/table/incident/{sys_id}
where request body is a json object just as simple as :
{
"comments": "My comment is foo bar"
}
but when this comment is registered on Service Now it is under integration user instead the user which commented. Is there any way I could keep a specific user, considering I already have the user id on Service Now ready to inform it on the request the way it should be.
I tried reading Service Now documentation but had no clue how to solve it, altought I've found something about impersonate
This is happening because you're being proxied through the "Integration User" instead of your own account. As long as this is the case, your comments are going to be attributed to the Integration User.
I can think of two ways to fix this issue.
Ask the client to log you into their system directly as a user.
Implement a special API (Scripted REST API, available in Geneva or later) that allows you to identify the Incident and enter the comment, and then the script forges the comment on your behalf, attributing authorship correctly.
The first solution can be expensive due to possible additional licensing costs.
The second solution will require a willing client to devote 2-3 hours of development time, depending on the programmer.
Firstly, you need an integration user with suffient rights. Our integration user has suffient rights out of the box, but your story could be different. A quick check is to try impersonate as other user using menu.
Login as integration user to ServiceNow instance.
Go to https://{instance}.service-now.com/nav_to.do
Click on username at top right corner. This is a drop down.
There should be at least three menu items: "Profile", "Impersonate User", and "Logout". If you do not have "Impersonate User" in this menu, your integration user miss some permissions. Contact system administrator if you miss this menu item to configure appropriate permissions.
Then you need to find sys_id of user that you want to impersonate. For example:
https://{instance}.service-now.com/api/now/table/sys_user?sysparm_query=user_name={username}&sysparm_fields=sys_id
If you have suffient privileges, you could invoke the folling endpoint with sys id of user that you want to impersonate:
HTTP POST to https://{instance}.service-now.com/api/now/ui/impersonate/{user_sys_id} with body "{}" and content type "application/json". You need to provide HTTP basic authentication to this query as your integration user.
The response code on success is 200. The response body could be ignored. The interesting result of this response is a set of cookies for impersonated user in response headers. These cookies could be used for subsequent REST API calls until they expire. Use some HTTP rest client dependent method to capture them and to provide them to next calls.
For Apache HTTP Client (Java), I'm creating http client context using:
HttpClientContext context = HttpClientContext.create();
context.setCookieStore(new BasicCookieStore());
Pass thing context to impersonation request and to subsequent API calls until I get 401 reply, after that I'm reaquiring cookies. Setting new cookie store is important, as otherwise some default cookies store is used.
Two things to note:
This API looks like internal one, so it could change at any time. If it happens, look for what "Impresonate User" menu item does, and repeat it youselves.
ServiceNow permissions are quite fine-grained, so the target user could lack permissions to perform operation. In some cases, if there is no permission to update the field the operation PATCH on object returns reponse 200, but field is not updated. This introduces a surprising mode of failure when you use impersonation.

Box.Net users-on-behalf-of-enterprise-user working

In Box developer document they ask to contact them with the API key generated.
Reference:
http://developers.box.com/docs/#users-on-behalf-of-enterprise-user
Is there is any api(Java) to get the other users mail box with the admin credential.
The primary purpose of "on-behalf-of" is to make calls on behalf of your company's users as an administrator. A great use case is if you'd like to prepopulate your new hire's account with a set of folders before they start on day 1.
In order to get the listing of enterprise users in your account, you would use the following API call if you are an administrator: http://developers.box.com/docs/#users-get-all-the-users-in-an-enterprise. This is currently not built into the Java SDK, but it is open source if you want to submit a pull request to it to add the functionality.

ios/Android targeted push notifications in AIR app

I was wondering if it is possible to have multiple custom push notifications setup in a single AIR App.
What I am trying to do is allow users to setup custom alerts based on information they would like to receive for example say user 1 would like to know when new actions or drama movies are released on DVD, user 2 would like to know when new comedies are released, user 3 would like to know when any new movie is released.
This is a simple example and there are possibly 1000's of options (postcode/zip information).
Thanks
Technically, there's nothing that wouldn't allow you to do this.
The implementation is mostly backend related though, let me just quickly draft a design for that here;
The user's device registers for push notifications at your backend service.
Your service takes the user's id stores in a DB and passes the device token to the corresponding push notification server.
Once the registration is completed, the user selects what items he'd like to get notified of (naturally your backend service has to know this information as well to store it in the DB).
As soon as a new action movie (or whatever kind of information the user registered for) is available, your service looks in the DB what users registered for that kind of movies and sends a message via push.
So a simple database and some server side scripting will get you going.