Is it possible to upload file to web api by calling Register method in Accounts controller - asp.net-web-api2

I have to upload user photo while registering a new user.The data from WPF application must consume the register method and inserts user detail and photo.
The register method accepts RegisterBindingModel , and i passed the model
properties in body as raw with content-type application json.But i am not able to upload file.
I know ,for uploading file we use form-data and we can pass additional parametes
in form data along with the file.But I need to get the file in api Register action method.
I have searched many articles and found files are uploading to api using form data.But those api methods does not accepts any input parameter.

Related

Metadata of Amazon S3 object not getting updated while making PUT request on API using Postman

I am following this documentation (https://aws.amazon.com/premiumsupport/knowledge-center/api-gateway-upload-image-s3/) to upload S3 object using API gateway, with no Lambda in between. This works using Postman! The object gets uploaded, but the user-defined metadata is not been reflected in the object.
I am trying to add user-defined metadata to headers, but that seems to be not working. I also tried to add "x-amz-meta-{key}": "{value}" in the form-data field of the body, and that did not work as well. Any recommended solution? Thanks in advance!
to Add metadata in PUT/POST request Created by API Gateway, you need to do the following:
Go to your API Method PUT/POST Method Request
Choose HTTP Request Headers then Add Header x-amz-meta-{YOUR-METADATA-NAME}
Go to your API Method PUT/POST Integration Request
Choose HTTP Headers then you will find your created Header in step 2 as Name (if not then create it) then in Mapped from Tab write
method.request.header.x-amz-meta-{YOUR-METADATA-NAME}
Deploy then send put request with header key as x-amz-meta-{YOUR-METADATA-NAME} and add your value then
visit s3 object you created then choose Edit Metadata then you find
the added metadata
to Get Metadata with GET request Created by API Gateway beside the object in response headers, you need to do the following:
Go to your API Method Response then unfold right Arrow located on the left of 200.
choose Add Header on Response Headers for 200 then Add x-amz-meta-{YOUR-METADATA-NAME}
Go to your API Method Integration Response
unfold Header Mappings then you will find Response Header you created in previous step (if not then create it) then Add integration.response.header.x-amz-meta-{YOUR-METADATA-NAME} in Mapping value tab
Deploy then test it using Postman then you find metadata in response headers
have a good luck.

How to call an external API from microstrategy workstation?

I am trying to call an external API of another application (bigID) (a GET call returning a json list) using microstrategy workstation.
I saw a way that it can be done through the "data from URL" option. But the problem is that the GET call I'm trying to do requires a header auth token. So I'm not sure how to load the data from that GET call onto microstrategy workstation to build a report
I'm very new to the tool. Can someone help me understand if this use case is possible to do?
An example of the GET call I'm trying to call
Request
Header : needs a auth token
Response
Returns a json list

Issues with retrieving profile image from Google Admin SDK/Directory API

I am trying to retrieve a user's profile picture in Python using either the users.get method or the users.photos.get method from the Google Directory API. I have set up my service account with the proper scope, and I get a 200 response when calling both endpoints, and can view actual data for every field, but when trying to access the profile image, I get a generic silhouette image. The methods I have used to try and access the profile images are:
With the users.get method, I have tried making a get call on the thumbnailPhotoUrl field using AuthorizedHttp under google.auth.transport.urllib3 from the Python google-auth package. The AuthorizedHttp object is created using the google service account credentials.
With the users.photos.get method I have tried decoding the photoData field with web-safe base64.
Most likely their photo is only linked to their Gmail account profile, which is inaccessible via the Admin API. You need to upload their photo directly through the admin.google.com GUI. Then your request will return that photo.

How to make an extension to save all messages in a conversation of Circuit Unify?

I am using Circuit Unify to work. However, I would like to save or export messages in a conversation into a file to save for better documentation. Currently it seems impossible on Web App as well as Desktop App. Thus, I want to make an extension (or app?) to do the work.
My question is: Where is the best place I should start with? How can I make an extension to Circuit? Is it possible to make such extension (or app)?
Your comments and suggestions will be greatly appreciated
Your best option is to use the Circuit JavaScript API to retrieve the messages using the API getConversationItems for example. Each item (aka message) contains the url(s) to download its attachments.
Now there are a few different ways this could be done.
Option 1: Using a bot
Create a bot (client credentials grant) that can be added to a conversation by a member of this conversation using the regular "Add participant" button on the Circuit client. This bot then has access to all messages of this conversation and can listen for new messages being posted. The bot can listen for a specific message (command) being sent, such as /export. When this command is sent, the bot retrieves all the data of this conversation to be exported, creates a pdf (or what ever format is required) and attaches this to the conversation. Alternatively the bot could also save that pdf in some other location, but that may pose a security issue.
Option 2: Using a separate web app
Create a web app on which users login using their Circuit credentials via OAuth (implicit or authorization code grant type). The app then acts on behalf of the logged on user. The app can list the conversations the user has access to (getConversations API) and show a button to export the selected conversation. The app then does the same as the bot in option 1 to create the pdf, but instead of posting the pdf to the conversation, the web app will download the pdf.
Option 3: Create a chrome extension
I do not encourage this option as there is no official way yet to extend the Circuit webclient. This means a new Circuit webclient version may break the extension. Using the chrome extension it would be possible to add an "Export" button in the UI and using some internal APIs get the data to be exported.
There is a plan to create official extension points to allow the developer to extend some part of the Circuit webclient and also use the JS SDK in a Chrome extension.
Note: You could also use the Circuit REST API instead of the JS SDK to
retrieve the messages.

API URI naming-similar functionality

We already have an API with the URI as Post/v1/payees used for the functionality to add payees. Another API has to be designed for this functionality but in this API only the control flow id shall need to be sent instead of all the fields required for adding the payee. The required fields shall be taken from cache for this API. Please help in suggesting the name for this API.