How to use Azure API Management portal or API to edit the description string for Ocp-Apim-Subscription-Key in the Request Header? - documentation-generation

I'm looking for a way to use Azure API Management (either the management portal or an API call) to edit the textual description of the Ocp-Apim-Subscription-Key Request header fields. This string shows up in auto-generated documentation, but I can't figure out where it's set. So far I've tried looking for the description string for the Ocp-Apim-Subscription-Key in the swagger file and in the API Management Publisher Portal, but haven't been able to find it.
Here is a screenshot highlighting the field in the generated API documentation that I want to edit:
Here is the page in the Azure API Management Publisher Portal where I looked for a Request Headers section and couldn't find it:
Other answers to questions about Azure API Management make me wonder if there's a REST API call to edit this string (if it's not available in the Publisher Portal) but I can't seem to find an active link to API documentation about it.

I use a Azure PowerShell for that. Prerequisite is that you're logged in (Login-AzureRmAccount) and selected your subscription (Select-AzureRmSubscription).
$ApiMgmtContext = New-AzureRmApiManagementContext -ResourceGroupName $resourceGroup -ServiceName $serviceName
if($ApiMgmtContext)
{
foreach($apiEntry in (Get-AzureRmApiManagementApi -Context $ApiMgmtContext))
{
$api = Get-AzureRmApiManagementApi -Context $ApiMgmtContext -ApiId $apiEntry.ApiId
Write-Host "setting header for" $api.Name
$api.SubscriptionKeyHeaderName = "MyApi-Subscription-Key"
$api | Set-AzureRmApiManagementApi -Context $ApiMgmtContext
}
}

Related

DocuSign Request Signature from API

We Have a Document Management System(DMS) which is .Net WebAPI Used to share Documents Between our employees,and stores the documents in our DB Can we implemet the workflows
1)
A authorised admin uploads a document into the API with names and Emails of signers and send it to them for signing and get the signed document and store it in our DB
through docusign
You can create a DocuSign envelope using the DocuSign eSignature API where you can specify signers ("recipients"), documents and fields ("tabs") that recipients need to take action on in those documents.
This is the API reference for the API call to create an envelope: https://developers.docusign.com/docs/esign-rest-api/reference/envelopes/envelopes/create/
This is an example How-To guide for a simple signature request using the various SDKs (including C#):
https://developers.docusign.com/docs/esign-rest-api/how-to/request-signature-email-remote/
You are able to download documents from DocuSign through the API as well: https://developers.docusign.com/docs/esign-rest-api/reference/envelopes/envelopedocuments/get/
This is an example How-To guide for downloading envelope documents using the SDKs: https://developers.docusign.com/docs/esign-rest-api/how-to/download-envelope-documents/
You can download the Quickstart example project in a language of your preference, which includes those How-To examples if you wanted to test it out: https://developers.docusign.com/docs/esign-rest-api/quickstart/
Or you can check out the Sample Apps here to see some example use cases: https://developers.docusign.com/sample-apps/
There are generally a few more concepts/terminology to be familiar with when working with the DocuSign APIs (such as how to authenticate). You can check out this page which has links to some of these general topics: https://developers.docusign.com/platform/

How to retrieve SharePoint Document details for particular record in MS CRM using FetchXML from Azure API

We have a case where we need to retrieve sharePoint Document details for particular record in Microsoft CRM, we need exactly two information from the record which are the filename and regardingobjectid (to whom this document belongs to).
I found this post:
https://mscrm16tech.com/2020/09/09/get-sharepoint-document-details-for-particular-record-in-ms-crm-using-fetchxml/
I followed the same approch and i used the fetchXML in c# console program it worked as expected but the probleme when I created an API in azure APIM which will communicate with dynamics to get the results of the fetchXML, here is the policy that I have created:
When I test the API I get this error message (statuscode 500)
NOTE: I checked the URL in the browser (with the same fetchXML) and it worked without a problem also the authorization token was added successfully! also I get the same problem when I tested it in Postman.
What is the problem? I really don't know what to do here, any help will be appreciated.

How to get "Apps usage activity" report via Google report api using program(c# nodejs)

How to get "Apps usage activity" report via Google report api
"Apps usage activity" is under Admin console\reports
You can follow first this documentation to know how to set up your application's authorization. The Authorize Requests documentation shows you how to set up your client's authorization using the OAuth 2.0 protocol. The request must be authorized by an authenticated user who has access to that data when your application requests private data.
You can also check these SO question and tutorial about Google Analytics Core Reporting API with C#. It allows you to query report data. Each query requires a view (profile) ID, a start and end date, and at least one metric. You may also supply additional query parameters such as dimensions, filters, and segments to refine your query.

Connect more than one project id to the Google Play Developer Console

When I try to execute a request for a Google developer API. purchases(). products(). get() I receive a 403 error: projectNotLinked.
The message tells me "The project id used to call the Google Play Developer API has not been linked in the Google Play Developer Console."
At this point I can go to the console, unlink a previous project, and link this one, run the code, and the code works.
However, I cannot unlink permanently the previous project: I need to keep them both linked. How do I solve this problem?
I looked around and couldn't find a solution. Tried to call Google, and they told me that they do not support this kind of requests.
Thanks in advance.
To reemphasise #andy's comment: There can only be one single linked API project.
I spend quite some time to find this out. Google's documentation is not helpful here.
If you need access to multiple projects/applications, you have to create multiple service accounts inside of the single linked API project and manages access to apps individually.
Andy's comment is correct, I find the description LINKED PROJECT in the Google Play Developer Console confusing at best.
However, I setup in the Google Developers Console a company project with the appropriate Server Keys and Service accounts. It isn't ideal, but it works. You can then assign permission to the required service account back in the Google Play Developer Console.
You can also setup just one key and service account if that makes it simpler and the use them as shown below in PHP for a server
$service_account_name = 'xxxxxxxxxx-xxxxxxxxxxxxxxx#developer.gserviceaccount.com';
$key_file_location = somedir/keyfile.p12;
$client = new Google_Client();
$client->setApplicationName("GoogleDevelopersConsoleProjectName");
$service = new Google_Service_AndroidPublisher($client);
$key = file_get_contents($key_file_location);
$cred = new Google_Auth_AssertionCredentials(
$service_account_name,
array('https://www.googleapis.com/auth/androidpublisher'),
$key
);
$client->setAssertionCredentials($cred);
if($client->getAuth()->isAccessTokenExpired()) {
$client->getAuth()->refreshTokenWithAssertion($cred);
}
$apiKey = "GoogleDevelopersConsoleServerKey";
$client->setDeveloperKey($apiKey);
$package_name = "com.yourcompany.yourappname1";
Then all you need to do for the other application is change the $package_name.
$package_name = "com.yourcompany.yourappname2";
Then using the Google Service AndroidPublisher to query subscriptions
$service = new Google_Service_AndroidPublisher($client);
$results = $service->purchases_subscriptions->get($package_name,$subscriptionId,$token,array());
You can also start to assign multiple keys, service accounts and other credentials you add other projects in the Google Play Developer Console.

Yammer REST API: 401 Unauthorized when using Azure AD token and Yammer Delegated Permissions

I am creating an Azure AD App that is using the new Yammer delegated permissions preview to post a message to Yammer using the access token that I obtained from Azure AD. Unfortunately, I get a 401 Unauthorized response when trying to call Yammer Rest APIs.
Here is the code sample:
var resourceId = "https://www.yammer.com";
var endpointUrl = "https://www.yammer.com/api/v1/messages/following.json";
AuthenticationHelper helper = new AuthenticationHelper();
helper.EnsureAuthenticationContext(AuthenticationHelper.AuthorityMultitenant, resourceId);
var token = helper.AuthenticationResult.AccessToken;
HttpClient hc = new HttpClient();
hc.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", token);
var result = await hc.GetAsync(new Uri(new Uri("https://www.yammer.com"), endpointUrl));
Here I get the 401 Unauthorized, with a message "Authentication failure". I tried also with api.yammer.com instead of www.yammer.com, with no change. I know that the tokens are being retrieved correctly, as I tested them with other Office 365 REST APIs.
My assumption is that the token is in an unaccepted format, but it is supposed to accept Azure Tokens now that the Delegated Permissions were added. Am I using the wrong resource ID and endpoint?
Your code sample looks correct. Does your user have an active Yammer subscription?
From an answer on the Yammer IT Pro Networks group for Office 365 developers, this:
Yammer authorization in apps is still handled completely separate from
the rest of Office 365. You need to create a Yammer app in your
network, and the users still needs to click the consent dialog to
authorize it.
Yes, there is a delegated permission for Yammer API in Azure AD, but
unless I am mistaken this does not actually do anything.
This is not from a Yammer source, because they never offer any kind of developer support or up-to-date documentation, but it seems entirely likely that this is another "feature" that simply doesn't work at all.
I have found the resolution for the problem. It appeared to be that Yammer authentication can be configured in 2 ways - one way is to configure it to use the same authentication as other parts of Office 365, and another one is to is using a different configuration.
If Yammer's own SSO is used (in other words, Yammer has a separaate configuration for ADFS), then this problem happens.If you disable Yammer SSO for your network, all yammer authentication for “mapped” users will be handled by Office365. When that’s done, you can then use the Office 365 API.

Resources