Flickr api - call photo sets - flickr

I have API key and API secret and i have downloaded the recent library 3.1.
When i use the example mentioned, i get public photos. And the library i am using included this file phpFlickr.php which has all methods.
I am now trying to access the photo sets api, which is not returning anything. And the document says there is no other authentication that is required. please check the code below
require_once("phpFlickr.php");
$f = new phpFlickr("56cc01317fdce40c31c8f66498746c4d");
$sets = $f->photosets_getList();

#sandy : If you want to show flickr slider gallery in your website then you can use pictobrowser its best way to display flickr and Piccasa albums on website.
Using PictoBrowser one can easily embed Flickr and Picasa photostreams in anywebsite. All you need is follow few simple steps given here.
- visit http://pictobrowser.com/
- Click PictoBuilder at the top left corner of the page.
- Enter your Flickr/Picasa username.
- Choose images/ albums.
- Set Tag or Groups.
- It outputs some HTML code
- Copy that HTML code and paste it in your website or blog.

Related

Add sample image in template header in whatsapp cloud API

I am doing a project using WhatsApp cloud API. I need to create a template with a media header. I have created a template with a media header without a sample image and it gets rejected. So I want to create a template with a sample image in Node JS.
Template with a media header
Add sample image for a template
curl -X POST "https://graph.facebook.com/v14.0/{whatsapp-business-account-ID}/message_templates
?name={template-name}
&language=en_US
&category=TRANSACTIONAL,
&components=[{
type:BODY,
text:{message-text}
},
{
type:HEADER,
format:IMAGE,
example:{header_handle:[{uploaded-image-file-url}]}
}],
&access_token={system-user-access-token}"
I want to add a sample image using Node JS (Not manually like the second picture).
header_handle requires a encrypted file upload provided by facebook.
This can be done by calling 2 apis.
First,
We have to create a session for the file to be uploaded.
For creating session refer this
After creating session, we will get session id to upload the original file to it.Response will look something like this:
{"id":"upload:MTphdHRhY2htZW50Ojlk2mJiZxUwLWV6MDUtNDIwMy05yTA3LWQ4ZDPmZGFkNTM0NT8=?sig=ARZqkGCA_uQMxC8nHKI"}
Second,We have to upload the file to
https://graph.facebook.com/v14.0/{above_id}
This will give a response something similar to
{"h":"2:c2FtcGxlLm1wNA==:image/jpeg:GKAj0gAUCZmJ1voFADip2iIAAAAAbugbAAAA:e:1472075513:ARZ_3ybzrQqEaluMUdI"}
Finally,
{header_handle:["2:c2FtcGxlLm1wNA==:image/jpeg:GKAj0gAUCZmJ1voFADip2iIAAAAAbugbAAAA:e:1472075513:ARZ_3ybzrQqEaluMUdI"]}
Should be added during the request to create template.
It worked for me.
See this for better understanding on how to do it.
The answer Provided by Aravindh is correct, you can follow This document from Meta to upload the Image you want.
Just make sure you use a supported type by WhatsApp API ( For WhatsApp Business Platform Cloud API , For WhatsApp Business Platform On-Premises API ) and the upload end point (file-type — The file's MIME type. Valid values are: image/jpeg, image/jpg, image/png, and video/mp4
)
Double Check if you are following exacly the types supported, for example in case of png, you need to set "file_type" to "image/png" no just "png" when creating the upload session.
I have tested it and it works for me.
Hope this helps

Microsoft Graph API - Copying SharePoint file - Item not found

I'm working with Graph API against Microsoft Teams team's SharePoint site.
I'm following the example on this page (https://learn.microsoft.com/en-us/graph/long-running-actions-overview?tabs=http) and have an issue. I'm able to query the location provided by the copy endpoint and get a "Completed" status that also provides a ResourceId. But I'm unable to use this resource id in any queries and only getting "Item not found".
Example of paths tried:
/drives/{driveId}/items/{resource-id-returned-from-monitor-url}
/groups/{groupId}/drive/items/{resource-id-returned-from-monitor-url}
The {driveID} is the driveId specified in the parentReference.DriveId in the copy file body.
I'm using the v1 Graph endpoint to get the file.
Btw, I can see the file fine in the correct folder within SharePoint.
Any ideas?
Regards,
Oskar
I wasn't using the DriveId supplied by the /education/***/setUpResourcesFolder Location header but rather the Drive of the class.
Fixed by using the driveId part of the Location URL.

Docusign - api get utl to download document

I need api to create URL link for download document of envelope.
I found this api:
GET /restapi/v2.1/accounts/{accountId}/envelopes/{envelopeId}/documents/{documentId}
But this api just return the file and i what a URL i can download the file (of course with expired time)
The endpoint you're looking for is:
POST /restapi/v2.1/accounts/{accountId}/envelopes/{envelopeId}/views/recipient
You will need to provide in the body information about the recipient, see here for details:
https://developers.docusign.com/esign-rest-api/reference/Envelopes/EnvelopeViews/createRecipient
We also have code examples in various langagues to show you how to do this here:
https://developers.docusign.com/esign-rest-api/code-examples/code-example-request-a-signature-via-email

How to update index page content of shopify store using API like we are update other pages content using shopify admin API

I am developing shopify public app. I just want to know that can I get store home page content for upadte and add new content there.
I am getting all pages details and it contents by using shopify admin API for get page,create page,update page and delete page
like here we use following path for update particular page with page_id
PUT /admin/api/2019-04/pages/#{page_id}.json
{
"page": {
"id": 131092082,
"body_html": "<p>Returns accepted if we receive the items 14 days after purchase.</p>"
}
}
I had details of all static pages but i don't know how to update home page details like this
Can any one please help me that how I can get home page content and update that content using API or refer me any admin API to get this. Thank you
The smart way to do this is as follows. In the theme itself, you can tell when you are on the index page since Shopify renders index.liquid. In there, you can make a callback to your App using the App Proxy. The App then provides custom data as JSON or perhaps even Liquid. So the index page can now render with your App being part of the cycle.
That is probably the best pattern for you to work with for your specifics.
Finally got the solution to update index.liquid page of shopify store as follow
First you have to get themes by following
GET https://shop_domain/admin/api/2019-04/themes.json
This API give you thmes.json which contains all themes details used in this store.
Now you have to get theme_id from theme.json for update particular page by theme_id.
Update asset API for update content of index page
URL for update assets by theme_id
PUT https://shop_domain/admin/api/2019-04/themes/#{theme_id}/assets.json
require body for update API
{
"asset": {
"key": "templates/index.liquid",
"value": "add your content"
}
}
And this will update index page content with your content . It work successfully for me Thank you

Get all items of a Sharepoint document library using Graph API

I'm trying to retrieve a document library by path using the Graph API and I'm not sure how to proceed.
The url to the library is for example the following:
https://hostname/sites/sitename/subsite/nameofdocumentlibrary/
I would like to have all the children through the Graph API. The issue: I know the document of the library but I don't know the ID of the library. It seems that it's possible to access it through the relative path but I'm not succeeding to it.
How do I do this?
My get url was the following:
/v1.0/sites/hostname:/sites/sitename/subsite/nameofdoccumentlibary/items
I'm always getting:
The provided path does not exist, or does not represent a site or UnknownError.
Any ideas ?
Try to use this:
GET https://graph.microsoft.com/v1.0/sites/{hostname},{spsite-id},{spweb-id}/lists/{list-id}
I don't check this in real life because I don't have SP Online. But it must working.
Use this link with SharePoint Graph API.
To get site id (site collection) you can go to your site collection and browse this endpoint:
https://hostname/sites/sitename/_api/site?$select=Id
To get web id (subsite) you can go to your subsite and browse this endpoint:
https://hostname/sites/sitename/subsite/_api/web?$select=Id
To get library Id you can just open Document Library Settings page. URL have library ID. You can transform it to real guid. Like this:
/_layouts/15/listedit.aspx?List=%7B603D7FA3-C801-46EB-A044-421234452901%7D
Must transformed to:
603D7FA3-C801-46EB-A044-421234452901
Following your feedback, I could now retrieve the document library using the display name (not the path in the url).
This is my request:
https://graph.microsoft.com/v1.0/sites/fullsubsiteid/lists/69369/items
69369 is my display Name here.
I can also use:
https://graph.microsoft.com/v1.0/sites/fullsubsiteid/lists/69369/drive
Now the first request, is returning an empty value array, while there is a "Documents" folder in the document library. How could I retrieve all folders/files etc in this document library? How can I use relative path?
Tx!

Resources