mailjet / mailjet-apiv3-php

[API v3] Mailjet PHP Wrapper
http://dev.mailjet.com
MIT License
267 stars 87 forks source link

I don't see the implementation for /contactdata + Bad Doc #2

Closed Jolg42 closed 9 years ago

Jolg42 commented 10 years ago

Hi !

The implementation of /contactdata documented here http://dev.mailjet.com/guides/personalisation-guide/ is not implemented yet ?

Also, the documentation is not good on some points, the worst is when you want to add custom fields, it was just a PITA…

The 'Name' & 'Value' fields are not documented here -> http://dev.mailjet.com/email-api/v3/contactdata/

And this is not cool in an open source repo :

@see http://mjdemo.poxx.net/~shubham/apikey.html
  1. It's password protected
  2. It seems it's your personal server @madflo ?

My code for future users, I'm using Guzzle in Symfony 2

$body = json_encode([
              'Data' => [
                        ['Name' => 'firstname', 'value' => $user->getFirstName()],
                        ['Name' => 'lastname', 'value' => $user->getLastName()],
                    ]
              ]);
$request = $client->createRequest('PUT', 'https://api.mailjet.com/v3/REST/contactdata/'.$user->getEmail(), [
                    'auth'=> ['api_key','api_secret'],
                    'body' => $body
                ]);
                $request->setHeader('Content-Type', 'application/json');
                $response = $client->send($request);
                $code = $response->getStatusCode();
                echo "--->".$code;
flegoff commented 10 years ago

I do agree with all of your points. The PHP wrapper is currently lagging behind… we will be updating everything in the coming weeks. As for the documentation.

flegoff commented 10 years ago

@tylernappy @shubs please move on with @ChibiJoel's suggestions

Jolg42 commented 10 years ago

@madflo Thank you :) :+1:

And the problem was also : new Mailjet accounts can't use the old API, isn't it ? So new users are forced to use the new v3 API but it's a little early perhaps.

Have a nice day !

orliesaurus commented 10 years ago

@ChibiJoel that's correct ! are you writing a wrapper for V3?

Jolg42 commented 10 years ago

@orliesaurus I don't have the time for that and 1 This library mailjet-apiv3-php can't be install via composer

  Problem 1
    - The requested package mailjet-apiv3-php could not be found in any version, there may be a typo in the package name.

And the name in composer.json isn't mailjet-apiv3-php it's mailjet/api

If you can publish it on https://packagist.org/ it will be a good thing. ping @madflo

2 I will not use a lot of functions. So for the moment my code with Guzzle will be good, clear, quick and it's working as expected.

orliesaurus commented 10 years ago

Okay @ChibiJoel thanks for reporting in - I was just asking out of curiosity :) EDIT: I think we will publish it there once we've fixed it and wrote a little bit more in the readme.md file thank you for the suggestion nonetheless

https://github.com/mailjet/mailjet-apiv3-php/commit/919573afd7a09a2466e96df9af80688e90921529

Jolg42 commented 10 years ago

@orliesaurus No problem ;) Have a nice evening !

roadster31 commented 8 years ago

The 'Name' & 'Value' fields are not documented here -> http://dev.mailjet.com/email-api/v3/contactdata/

Still not documented 2 years after.

Generally speaking, types are not documented at all, and example are just simplistic. I spent HOURS to figure out how to pass parameters to some requests.

arnaudbreton commented 8 years ago

@roadster31 I believe what you're looking for is our API Guides, which provide the level of information you need to get things right. In your case, I believe this guide is what you're looking for.

Hope it helps, Best.

roadster31 commented 8 years ago

Thanks for this reply, this guide is fine.

However, more examples in the API references would be fine too.

arnaudbreton commented 8 years ago

Thanks @roadster31, glad to hear the guide was what you were looking for.

We definitely plan to improve our API reference over the coming months.

You should subscribe to our API Newsletter or follow us on Twitter to follow our progress there.

Best