I am using wso2 api manager.In that,is it possible to limit number of applications that can be created by a tenant or an user in devportal?
By default, it is not possible to limit the number of applications that can be created. One possible way is to achieve it with the UI customization. Devportal REST API - GET /applications can be used to retrieve all the application details. The response of this resource looks like:
{
"count": 1,
"list": [
{
"applicationId": "xxxxx",
"name": "xxxxxx",
"throttlingPolicy": "Unlimited",
"description": "",
"status": "APPROVED",
"groups": "",
"subscriptionCount": 0,
"attributes": "",
"owner": "admin"
}
],
"pagination": {
"offset": 0,
"limit": 1,
"total": 10,
"next": "",
"previous": ""
}
}
You can disable the Add new application button from UI, if the total number of application exceeds the value you want.
The default limit of applications getting listed in devportal is 25. You can still create new applications beyond 25, but they won't get listed in UI, unless you delete the earlier ones.
To completely disallow user to create new applications once the preferred limit is exceeded, disabling the Add new application button once the limit is exceeded together with a warning message will resolve.
Related
We are creating an application that processes signed documents. As part of the testing process, I'd like to automate the creation and signing of sample documents. How can I sign the documents via postman?
Using the Postman scripts located at the DocuSign/blog, I can authenticate:
https://{{hostenv}}/restapi/{{apiVersion}}/login_information?api_password=true
{
"loginAccounts": [
{
"name": "Personal",
"accountId": "9",
"baseUrl": "https://demo.docusign.net/restapi/v2.1/accounts/9",
"isDefault": "true",
"userName": "Chris",
"userId": "",
"email": "",
"siteDescription": ""
}
],
"apiPassword": "="
}
and then create an envelope to be signed...
{{baseUrl}}/envelopes
{
"recipients": {
"signers": [
{
"email": "{{signer1Email}}",
"name": "{{signer1Name}}",
"recipientId": 1,
"tabs": {
"signHereTabs": [
{
"xPosition": "100",
"yPosition": "100",
"documentId": "1",
"pageNumber": "1"
}
]
}
}
]
},
"emailSubject": "DocuSign API - Signature Request on Document Call",
"documents": [
{
"documentId": "1",
"name": "blank1.pdf",
"documentBase64": "JVBERi0x..."
}
],
"status": "sent"
}
Is there a way - via postman - to sign the envelope that was just created?
I've been exploring a more involved setup (Selenium, etc) but was wondering if documents can be signed via postman.
As Inbar states, you can't automatically sign an envelope using the DocuSign API. One alternative is to Correct the envelope to change the Signer to a Carbon Copy recipient, which would immediately complete their role in the envelope.
You cannot sign envelopes via the REST API (or any other API).
You can use UI automation techniques to click things on the page and sign envelopes this way.
there's a similar question that was asked here, it has an answer from an automation expert who did this - DocuSign integration tests
I'm trying to create snapshots of my vm instance on google cloud platform with a custom tag, but it's currently not working as expected. I'm sending the following Post request body to API referring to this documentation Google docs
{
"name":"<SnapshotName>",
"labels": {
"<LabelKey>":"<LabelValue>"
}
}
this gives me a positive 200 OK response, but no label appears.
{
"kind": "compute#operation",
"id": "<id>",
"name": "<name>",
"zone": "<Zone Link>",
"operationType": "createSnapshot",
"targetLink": "<Target Link>",
"targetId": "<Target ID>",
"status": "PENDING",
"user": "<User>",
"progress": 0,
"insertTime": "<Time>",
"selfLink": "<Self Link>"
}
additionally I tried to use syntax described in "Labeling Resources" documentation Google Labeling Resources
{
"name":"<SnapshotName>",
"labels": [{
"<Key>":"<LabelKey>"
"<Value>":"<LabelValue>"
}]
}
this gave me the same result.
In web interface it's possible to create snapshots and label it manually, but I would like to create them with a custom label via API.
Am I doing something wrong, or is it just broken?
I've followed this Slack tutorial to create an onboarding bot that gives people a few tips on how to interaction with other members. The tutorial recommends using Postman to test onboard experience, but it's not clear on how. I'm getting stuck on this: where do I put the a authorization token?
Prereqs:
ngrok is running on port 9292
rackup was run to start the server
I followed all steps to configure the Slack app as shown in the tutorial
I clicked the Slack button to authorize the application
What I'm doing:
Using Postman macOS client to send this default JSON event for team_join to the /events endpoint:
{
"type": "team_join",
"user": {
"id": "U023BECGF",
"name": "bobby",
"deleted": false,
"color": "9f69e7",
"profile": {
"first_name": "Bobby",
"last_name": "Tables",
"real_name": "Bobby Tables",
"email": "bobby#slack.com"
},
"is_admin": true,
"is_owner": true,
"is_primary_owner": true,
"is_restricted": false,
"is_ultra_restricted": false,
"has_2fa": false,
"two_factor_type": "sms"
}
}
I've tried including token as a parameter, header key/value and within the JSON object. None of these approaches seems to do it and it results in an authorization error. I get Invalid Slack verification token received: or a parsing issue.
How does one test something like a new user joining using this setup?
The token is available within the Event envelope, so you'll need to go up one level in the JSON:
{
"token": "{{verification_token}}",
"team_id": "{{team_id}}",
"api_app_id": "{{app_id}}",
"event": {
"type": "team_join",
"user": {
"id": "{{user_id}}",
"team_id": "{{team_id}}",
"name": "{{user_name}}",
"deleted": false,
"status": null,
"real_name": "{{user_real_name}}",
"profile": {
"first_name": "{{user_first_name}}",
"last_name": "{{user_last_name}}",
"real_name": "{{user_real_name}}",
"real_name_normalized": "{{user_real_name}}"
},
"is_bot": false
}
},
"type": "event_callback",
"authed_users": ["{{authed_user}}"]
}
I try to implement delete method for Record delate-record, but its my first time to use python and this api.
The GoDaddy API doesn't have a delete record method, so this functionality is not exposed in the driver.
https://developer.godaddy.com/doc#!/_v1_domains/recordReplace
The driver could offer the 'replace records in zone' method, which would allow you to fetch the current list of records, and then set the new list minus the record you want to remove. But that feature is not implemented and quite risky.
First,
Send a GET request to https://api.godaddy.com/v1/domains/{DOMAIN}/records
Then, Enumerate over all records of API Response (JSON Array) and prepare new data by removing the one that needs to be deleted.
API Response (SAMPLE)
[
{
"data": "192.168.1.1",
"name": "#",
"ttl": 600,
"type": "A"
},
{
"data": "ns1.example.com",
"name": "#",
"ttl": 3600,
"type": "NS"
},
{
"data": "#",
"name": "www",
"ttl": 3600,
"type": "CNAME"
},
{
"data": "mail.example.com",
"name": "#",
"ttl": 3600,
"priority": 1,
"type": "MX"
}
]
New Data (After deleting record) (SAMPLE)
[
{
"data": "192.168.1.1",
"name": "#",
"ttl": 600,
"type": "A"
},
{
"data": "ns1.example.com",
"name": "#",
"ttl": 3600,
"type": "NS"
},
{
"data": "#",
"name": "www",
"ttl": 3600,
"type": "CNAME"
}
]
Now,
Send a PUT request to https://api.godaddy.com/v1/domains/{DOMAIN}/records with new data.
The most important thing is how you identify the records in above array which needs to be deleted. This would not be a difficult task, assuming you have good programming skills.
I managed to worked around it in kind of a hacky - we had bunch of records we wanted to delete, doing it manually seemed weird so I added a Javascript into the Chrome Developer Console, running on an authenticated session from the DNS manage page:
function deleteGoDaddyRecords(recordId) {
$.ajax({
url: 'https://dcc.godaddy.com/api/v3/domains/<YOUR-DOMAIN.com>/records?recordId='+recordId,
type: 'DELETE',
success: function(result) {
console.log(result)
}
});
}
which let me use the same call the UI is calling when you ask to delete a record.
the only thing you need to provide is the AttributeUid which is not available with the public API, but it is in the front-end API:
https://dcc.godaddy.com/api/v2/domains/runahr.com/records
So I managed to create a script that will generate bunch of
deleteGoDaddyRecords('<RECORD-UUID>');
deleteGoDaddyRecords('<RECORD-UUID>');
copy & paste the generated script into the Developers Console and that solved it for now.
I hope GoDaddy will add a public DELETE endpoint to their API in the future :)
I have used google app engine with django application. I have been using the user api from google to login in my website and also getting the current user email address from that, but i have to get profile picture which is uploded on the google plus account.
I am getting their profile picture using,
<img src="https://plus.google.com/s2/photos/profile/<user_id>?sz=100" width="100" height="100">
in google api.
User class also provides user_id but I cannot get their profile picture using that user_id.
<user_id> and user_id of user class of Google API is different.
How to get the profile picture in my application?
The way to do it is to use the google+ api here: https://developers.google.com/apis-explorer/#p/plus/v1/plus.people.get?userId=me&_h=2&
This is the request to pull the image for the currently authenticated user.
GET https://www.googleapis.com/plus/v1/people/me?key={YOUR_API_KEY}
You'll get a json response like this and it's really easy to parse that and pull out the image->url value to display.
{
"kind": "plus#person",
"etag": "\"XxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXxXx\"",
"gender": "male",
"emails": [
{
"value": "jbrahy#XxXxXxXx.com",
"type": "account"
}
],
"objectType": "person",
"id": "XxXxXxXxXxXxXxXxXxXxXxXx",
"displayName": "John Brahy",
"name": {
"familyName": "Brahy",
"givenName": "John"
},
"url": "https://plus.google.com/XxXxXxXxXxXxXxXxXxXxXxXx",
"image": {
"url": "https://lh3.googleusercontent.com/XxXxXxXx/XxXxXxXx/XxXxXxXx/XxXxXxXx/photo.jpg?sz=50"
},
"isPlusUser": true,
"language": "en",
"circledByCount": 2,
"verified": false,
"cover": {
"layout": "banner",
"coverPhoto": {
"url": "https://lh5.googleusercontent.com/XxXxXxXx/XxXxXxXx/XxXxXxXx/XxXxXxXx/XxXxXxXx/Green%2BGrass.jpg",
"height": 240,
"width": 420
},
"coverInfo": {
"topImageOffset": 0,
"leftImageOffset": 0
}
},
"domain": "XxXxXxXx-x.com"
}
If you are asking the about the ids...
My GoogleID according to user_id() is xxx8005350796570706xx and my Google Plus profile ID is 102445631084043565507 which are totally different
You need to ask the user for his G+ profile or authenticate him via oAth2.0 to get permissions to read his profile.
Also if you have his email address you could use GAvatar.