api access to cloud drives attachment (url) - export

Can we get attachment URL trough podio API if we use a cloud drive ex: onedrive or dropbox?
Unfortunately offical export function doesn't containt that URLs.
Can we reach this data through API?
thank you

You can get a URL for a Dropbox file, although it is a shortened URL. Here's how I did it:
I attached a Dropbox file to an item. First, I looked up the ID of the associated item (https://developers.podio.com/doc/items/get-item-22360) and used the API to retrieve the item's details. Within the response JSON you will find a list of files that looks something like this (some details shown below are redacted to protect the innocent):
"files": [
{
"mimetype": "application/pdf",
"perma_link": null,
"hosted_by": "dropbox",
"replaces": [
],
"description": null,
"hosted_by_humanized_name": "Dropbox",
"presence": null,
"created_via": {
"url": null,
"auth_client_id": 1,
"display": false,
"name": "Podio",
"id": 1
},
"created_by": {
"user_id": REDACTED,
"name": "REDACTED",
"url": "https://podio.com/users/REDACTED",
"type": "user",
"image": {
"hosted_by": "podio",
"hosted_by_humanized_name": "Podio",
"thumbnail_link": "REDACTED",
"link": "REDACTED",
"file_id": REDACTED,
"external_file_id": null,
"link_target": "_blank"
},
"avatar_type": "file",
"avatar": REDACTED,
"id": REDACTED,
"avatar_id": REDACTED,
"last_seen_on": "2016-10-31 20:56:58"
},
"thumbnail_link": null,
"created_on": "2016-10-31 20:59:41",
"link": "https://db.tt/N3sW8SwL",
"file_id": REDACTED,
"rights": [
"view",
"download",
"delete",
"update"
],
"push": null,
"external_file_id": "/Get Started with Dropbox.pdf",
"link_target": "_blank",
"size": null,
"name": "Get Started with Dropbox.pdf"
}
]
I believe the field you are looking for is "link," but it appears to contain a shortened URL instead of the full-length URL.

Related

Azure Search - Cannot merge (with skill) data obtained from the KeyPhraseExtractionSkill

I am creating an indexer that takes a document, runs the KeyPhraseExtractionSkill and outputs it back to the index.
For many documents, this works out of the box. But for those records which are over 50,000, this does not work. OK, no problem; this is clearly stated in the docs.
What the docs suggest is so use the Text Split Skill. What I've done is use the Text Split skill, split the original document into pages, pass all pages to the KeyPhraseExtractionSkill. Then we need to merge them back, as we'd end up with an array of arrays of strings. Unfortunately, it seems that the Merge Skill does not accept an array of arrays, just an array.
https://i.imgur.com/dBD4qgb.png <- Link to the skillset hierarchy.
This is the error reported by Azure:
Required skill input was not of the expected type 'StringCollection'. Name: 'itemsToInsert', Source: '/document/content/pages/*/keyPhrases'. Expression language parsing issues:
What I want to achieve in the end of the day is to run the KeyPhraseExtractionSkill for text which is larger than 50,000 to add it back to the index eventually.
JSON for skillset
"#odata.context": "https://-----------.search.windows.net/$metadata#skillsets/$entity",
"#odata.etag": "\"0x8D957466A2C1E47\"",
"name": "devalbertcollectionfilesskillset2",
"description": null,
"skills": [
{
"#odata.type": "#Microsoft.Skills.Text.SplitSkill",
"name": "SplitSkill",
"description": null,
"context": "/document/content",
"defaultLanguageCode": "en",
"textSplitMode": "pages",
"maximumPageLength": 1000,
"inputs": [
{
"name": "text",
"source": "/document/content"
}
],
"outputs": [
{
"name": "textItems",
"targetName": "pages"
}
]
},
{
"#odata.type": "#Microsoft.Skills.Text.EntityRecognitionSkill",
"name": "EntityRecognitionSkill",
"description": null,
"context": "/document/content/pages/*",
"categories": [
"person",
"quantity",
"organization",
"url",
"email",
"location",
"datetime"
],
"defaultLanguageCode": "en",
"minimumPrecision": null,
"includeTypelessEntities": null,
"inputs": [
{
"name": "text",
"source": "/document/content/pages/*"
}
],
"outputs": [
{
"name": "persons",
"targetName": "people"
},
{
"name": "organizations",
"targetName": "organizations"
},
{
"name": "entities",
"targetName": "entities"
},
{
"name": "locations",
"targetName": "locations"
}
]
},
{
"#odata.type": "#Microsoft.Skills.Text.KeyPhraseExtractionSkill",
"name": "KeyPhraseExtractionSkill",
"description": null,
"context": "/document/content/pages/*",
"defaultLanguageCode": "en",
"maxKeyPhraseCount": null,
"modelVersion": null,
"inputs": [
{
"name": "text",
"source": "/document/content/pages/*"
}
],
"outputs": [
{
"name": "keyPhrases",
"targetName": "keyPhrases"
}
]
},
{
"#odata.type": "#Microsoft.Skills.Text.MergeSkill",
"name": "Merge Skill - keyPhrases",
"description": null,
"context": "/document",
"insertPreTag": " ",
"insertPostTag": " ",
"inputs": [
{
"name": "itemsToInsert",
"source": "/document/content/pages/*/keyPhrases"
}
],
"outputs": [
{
"name": "mergedText",
"targetName": "keyPhrases"
}
]
}
],
"cognitiveServices": {
"#odata.type": "#Microsoft.Azure.Search.CognitiveServicesByKey",
"key": "------",
"description": "/subscriptions/13abe1c6-d700-4f8f-916a-8d3bc17bb41e/resourceGroups/mde-dev-rg/providers/Microsoft.CognitiveServices/accounts/mde-dev-cognitive"
},
"knowledgeStore": null,
"encryptionKey": null
}```
Please let me know if there is anything else that I can add to improve the question. Thanks!
[1]: https://i.stack.imgur.com/GNf7F.png
You don't have to merge the key phrase outputs to insert them to the index.
Assuming your index already has a field called mykeyphrases of type Collection(Edm.String), to populate it with the key phrase outputs, add this indexer output field mapping:
"outputFieldMappings": [
...
{
"sourceFieldName": "/document/content/pages/*/keyPhrases/*",
"targetFieldName": "mykeyphrases"
},
...
]
The /* at the end of sourceFieldName is important to flattening the array of arrays of strings. This will also work as the skill input if you want to pass an array of strings to another skill for other enrichments.

angular looping json object and filtering data

my angular application will recive object's from backend
{
"count": 6,
"next": null,
"previous": null,
"results": [
{
"id": 160,
"title": null,
"rate": 5,
"author": "anonymous",
"content": null,
"review": "here is the review",
"url": "https://blog.com/?p=198",
"fake": true,
"tags": [
"thi"
],
"comments": [],
"created_at": "2020-06-13T20:24:32.434131Z",
"advertisement": {
"id": 55,
"created_at": "2020-06-13T20:24:32.432084Z",
"title": null,
"url": null,
"advertizing_content": null
}
},
JSON data structure from backend
i have converted array
var dat:any=JSON.stringify(backenddata);
this.z = backenddata["results"][0];
and seleted results
{
"id": 160,
"title": null,
"rate": 5,
"author": "anonymous",
"content": null,
"review": "here is the review",
"url": "https://blog.com/?p=198",
"fake": true,
"tags": [
"thi"
],
"comments": [],
"created_at": "2020-06-13T20:24:32.434131Z",
"advertisement": {
"id": 55,
"created_at": "2020-06-13T20:24:32.432084Z",
"title": null,
"url": null,
"advertizing_content": null
}
},
i want to fetch all the tags in every object
console.log(this.z.tags)
i just got "undefined" in console
I tried
Object.values(tags);
i tried everything regarding this objects part
objects.values,keys and all
when i tried
console.log(object.values(y)[8]);(y here is the json object)
i'm just getting a value of first object's tag
i want to loop all the objects segregate those tags and save it in variable
refereed many stack overflow thread's but its of no use
i have no clue what exactly is wrong
https://www.youtube.com/watch?v=23ZjKQL-2E4&t=509s
also tried this tutorial
still its of no use
i just want to fetch all the tags of every object of thatjson response and save it
If you need tags from all the objects of the results array, you could use the map function. Try the following
tags = [];
this.someService.getData().subscribe(
data => {
this.tags = data['results'].map(result => result['tags']);
// this.tags = [['thi'], ['thi', 'ths'], ...]
},
error => { }
);

DocuSign signers and non-signers routing

I am currently not specifying any routing order for signers and non-signers(cc recipients). In this case non-signers get the email only when the signers have signed and completed the envelope. I need for non-signers to get email same time as signers (before signers sign) as well as after signers sign and complete. How to achieve this. I alresy looked at this solution Docusign - Adding a non signing CC role with same routing order
But when I tried different roleNames and same routing order I get "errorCode": "ENVELOPE_HAS_DUPLICATE_RECIPIENTS",
How do we differtiate between signers and non-signers? I tried to use different role names, but did not work.
My request json:
{
"status": "created",
"recipients": {
"signers": [{
"tabs": {
"signHereTabs": [],
"initialHereTabs": [],
"dateSignedTabs": []
},
"routingOrder": '1',
"roleName": "Signer",
"recipientId": "1",
"name": "Signer Name",
"email": "someone#somewhere1.com",
"clientUserId": null
}],
"carbonCopies": [{
"routingOrder": "1",
"roleName": "CCRole",
"recipientId": "1",
"email": "someone1#somewhere.com"
}, {
"routingOrder": "2",
"roleName": "CCRole",
"recipientId": "2",
"email": "someone2#somewhere.com"
}]
},
"messagelock": "false",
"emailsubject": "DocuSign:1xxxxx78-03 - Testcase",
"emailblurb": "Please sign attached document(s)",
"documents": [{
"name": "11xxxxxx8-01- Documents",
"documentid": "1",
"documentBase64": null
}],
"customFields": {
"textCustomFields": [{
"value": "a54c00000000ogaAAA",
"show": "false",
"required": "true",
"name": "DSFSSourceObjectId",
"fieldId": null
}]
}
}
Recipients at the same routing order will receive emails simultaneously when the envelope reaches the particular routing order. In addition a CarbonCopy recipient will also receive an email that an envelope is completed.
Carbon Copy Recipients
Documentation here
Carbon copy recipients get a copy of the envelope but don't need to sign, initial, date or add information to any of the documents. This type of recipient can be used in any routing order. Carbon copy recipients receive their copy of the envelope when the envelope reaches the recipient's order in the process flow and when the envelope is completed.
Sending Envelope with notifications to CC recipients before and after Signer
Documentation here
You are getting the ENVELOPE_HAS_DUPLICATE_RECIPIENTS error message since you have specified recipientId = 1 for multiple recipients. Also you can remove the roleName as there is no template involved.
Here is an example that should work for your use case. I am using unique routing order and recipient ID for each of the recipients.
POST /v2/accounts/{accountId}/envelopes
{
"emailSubject": "Envelope with 1 cc - 1 signer - 1 cc",
"status": "sent",
"recipients": {
"signers": [
{
"email": "AndySigner#acme.com",
"name": "Andy Signer",
"recipientId": "2",
"routingOrder" : "2",
"tabs": {
"signHereTabs": [
{
"documentId": "1","pageNumber": "1", "xPosition": "80", "yPosition": "80",
}
]
}
}
],
"carbonCopies": [
{
"name": "Jane CC",
"email": "Janecc#acme.com",
"recipientId": "1",
"routingOrder": "1"
},
{
"name": "Bob CC",
"email": "BobCC#acme.com",
"recipientId": "3",
"routingOrder": "3"
}
],
},
"documents": [
{
"documentId": "1",
"name": "Contract",
"fileExtension": "txt",
"documentBase64": "RG9jIFRXTyBUV08gVFdP"
}
]
}

How to save png image in mongodb with angularjs and deployd

I am working on an app where I need to retrieve images from URLS (for example http://foo.com/bar.png) and save them in mongodb. The app is built using angularjs and uses deployd for the API stuff. Here is the config.js file for the image collection:
{
"type": "Collection",
"properties": {
"image": {
"name": "image",
"type": "image/png",
"typeLabel": "image/png",
"required": true,
"id": "image",
"order": 0
}
}
}
I have tried searching but I was unable to find anything for images and deployd. I just need a simple way to retrieve images from URLs, save them in mongodb and then render them later on.
There's no column type image/png AFAIK. We can use string instead of it. Why not inserting the image as data uri?
{
"type": "Collection",
"properties": {
"image": {
"name": "image",
"type": "string",
"typeLabel": "string",
"required": true,
"id": "image",
"order": 0
}
}
}

Why is attachmentId missing in payload/parts/body from certain emails?

I'm using the gmail API to first generate a list of all attachments, and then download the attachments on demand.
I'm basically calling GET https://www.googleapis.com/gmail/v1/users/me/messages/{ID}?key={YOUR_API_KEY} on all message ids that have an attachment, and then grabbing all the attachmentIds to use with the messages.attachments API later. This works for the majority of my attachments, but I notice for certain emails, the attachment ID is missing.
Heres an example response (with certain parts omitted) from such one of those emails:
{
"id": "114fda8b3fe57cb1",
"threadId": "114fda8b3fe57cb1",
"labelIds": [
"INBOX"
],
"snippet": "",
"historyId": "1027074",
"payload": {
"mimeType": "multipart/mixed",
"filename": "",
"headers": [
],
"body": {
"size": 0
},
"parts": [
{
},
{
"partId": "1",
"mimeType": "image/jpeg",
"filename": "IMG_3746.JPG",
"headers": [
{
"name": "Content-Type",
"value": "image/jpeg; name=\"IMG_3746.JPG\""
},
{
"name": "Content-Transfer-Encoding",
"value": "base64"
},
{
"name": "Content-Disposition",
"value": "attachment; filename=\"IMG_3746.JPG\""
},
{
"name": "X-Attachment-Id",
"value": "f_1ydodxn"
}
],
"body": {
"size": 447292 <------ Here is where I would expect attachmentId to be...
}
},
{
}
]
},
"sizeEstimate": 2873869
}
Here's what the parts/body looks like from a response from a message that has everything I expected:
"body": {
"attachmentId": "ANGjdJ9CRk8VcuxPzOMnGhFQdJpB6vc7xNAZTw5Gav3jZRQkEi3lRvELnjUTEqQtpiJDkKx8IR3qEOyT0wW6LD_tQ3NvPWDucURPaW0xUBJm8gwP-De9hOt7DbciRdfYCX79JWoHtGS2cooTzpAfZwYXc2lmcjCeL_SvgCZAtIEOVs45atTOsx9BCb02aJzNAvga2f3OdsBNbUkCyyZWQZGB0bHQf4q30BmoDFLrBhq67k3f5VOpOxsFl4QDLS5Md-JxhbQ1qsFk_usEUvcOqFsNgckmtj6y0zrKyDDc8g",
"size": 536
}
I can't use GET messages/attachments without the attachmentId... whats going on? What am I missing?
Looks like that was an issue with some older attachments. Should be resolved now.
In my case (using API in Python) the attachmentId was never in the body.
I went here:
https://developers.google.com/gmail/api/reference/rest/v1/users.messages/get
to use "Try this method" window
and I found the attachmentId in parts[1].body

Resources