Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

I want to integrate Fotolia API in my WP Site

242 views
Skip to first unread message

Sylvain Bernard

unread,
Jun 8, 2016, 6:09:48 AM6/8/16
to Fotolia API
Hi, I'm not a geek in programmation and i want to integrate Fotolia API to my site.

If i understand, i have the choice between PHP, JAVA ?

I download and install a PHP custom extension on my site.

I take this PHP Code on your site to put in my PHP Extension
#!/usr/bin/env php
<?php

require_once 'fotolia-api.php';

$api = new Fotolia_Api('your_api_key');

// searching for files
$results = $api->getSearchResults(
    array(
        'words' => 'car',
        'language_id' => Fotolia_Api::LANGUAGE_ID_EN_US,
        'limit' => 1,
    ));

printf("Found %d results", $results['nb_results']);

foreach ($results as $key => $value) {
    // iterating only over numeric keys and silently skip other keys
    if (is_numeric($key)) {
        printf("matching media ID: %d", $value['id']);
    }
}

// loggin in and retrieving user data
$api->loginUser('your_login', 'your_password');
print_r($api->getUserData());

// purchasing and downloading a file
$dl_data = $api->getMedia(35957426, 'XS');
$api->downloadMedia($dl_data['url'], '/tmp/' . $dl_data['name']);

Nothing seems to works.

Help me please 

Andrey @ Fotolia

unread,
Jun 15, 2016, 4:06:43 AM6/15/16
to Fotolia API
Hi Sylvain,

You're not limited to the language you can use to implement the API but there are kits provided for Java and PHP. Are you hosting your own site or using a service? And what kind of errors are you receiving?

Andrey

Graffiks.ca

unread,
Jun 15, 2016, 7:12:10 AM6/15/16
to fotol...@googlegroups.com
Hi Andrey, my site hosting on www.rapidenet.ca and i can use php with them.

For now, I just do not know how to do with the kit.
On wordpress, I know I can integrate plugins that allow me to use Java or PHP and I try several but it did not work.
That is why it would have been easier for me to have an HTML kit

Thanks

Le 16-06-15 à 04:06, Andrey @ Fotolia a écrit :
--
You received this message because you are subscribed to the Google Groups "Fotolia API" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fotoliaapi+...@googlegroups.com.
To post to this group, send email to fotol...@googlegroups.com.
Visit this group at https://groups.google.com/group/fotoliaapi.
For more options, visit https://groups.google.com/d/optout.

--


Sylvain Bernard  
Directeur, Graffiks.ca
Reply all
Reply to author
Forward
0 new messages