-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added getting started and authentication page #224
base: 5.x
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR @MutiatBash - I've made a few comments but proper reviewing is blocked by #225 which is required to unblock building locally. I'm also noticing that Vale isn't checking this page correctly so we might need to check that, too.
docs/rest_api/getting_started.rst
Outdated
|
||
.. note:: | ||
|
||
Mautic has an API library available for PHP. You can `find it on GitHub <https://github.com/mautic/api-library>`_. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mautic has an API library available for PHP. You can `find it on GitHub <https://github.com/mautic/api-library>`_. | |
Mautic has an API library available for PHP. Check out the :xref:`Mautic API Library`. |
This needs converting to a link macro. There is already a link file in /links, you can check for the name and use the xref macro as above.
docs/rest_api/getting_started.rst
Outdated
|
||
To get started easily, you can use Mautic's Postman collection: | ||
|
||
.. image:: https://run.pstmn.io/button.svg |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is very incomplete right now, I'd personally leave this out until we fill it out a bit.
} | ||
} | ||
|
||
.. vale off |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are you turning off Vale here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @RCheesley ...Thank you very much fo your feedback...it's my first time writing rst or hearing about vale....I pretty much copied the content that was linked in the PR you dropped and just made little changes, so i'm really not sure why it was initially added...hence, the reason i didn't take it off...but i'll look into it.
docs/rest_api/getting_started.rst
Outdated
|
||
.. vale off | ||
|
||
API Rate limiter cache |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
API Rate limiter cache | |
API rate limiter cache |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this one isn't yet resolved.
docs/rest_api/getting_started.rst
Outdated
|
||
``$version`` is in a semantic versioning format: ``[major].[minor].[patch]``. For example: ``2.4.0``. If you'll try it on the latest GitHub version, the version has ``-dev`` at the end. Like ``2.5.1-dev``. | ||
|
||
.. vale off |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no need to turn Vale off here. Instead, fix the problem :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MutiatBash a small Vale fix here, too.
docs/rest_api/authentication.rst
Outdated
* - Authorization code flow | ||
- This flow is best if you want Users to log in with their own Mautic accounts. All actions taken get registered as if the User performed them in Mautic's UI. | ||
* - Client Credentials flow | ||
- This flow is best for Machine-to-Machine, M2M, communications. For example, in cron jobs that run on at fixed times of the day. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- This flow is best for Machine-to-Machine, M2M, communications. For example, in cron jobs that run on at fixed times of the day. | |
- This flow is best for Machine-to-Machine, M2M, communications. For example, in Cron jobs that run on at fixed times of the day. |
Vale fix
@RCheesley .....I've made the suggested changes, can you review them |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the great work @MutiatBash - just a few small tweaks to fix then it should be good to merge!
|
||
|
||
Plain HTTP requests | ||
=================== |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
=================== | |
=================== | |
.. vale on |
Turn it back on here.
docs/rest_api/authentication.rst
Outdated
$api = new MauticApi(); | ||
$contactsApi = $api->newApi('contacts', $auth, $apiUrl); | ||
$contacts = $contactsApi->getList(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.. vale off |
Let's turn off Vale here as we are purposely going against the grammar rules to use a specific term.
docs/rest_api/authentication.rst
Outdated
The OAuth processes can be tricky. If possible, it's best to use an OAuth library for the language that's used. If you're using PHP, Mautic recommends using the :xref:`Mautic API Library`. | ||
|
||
Step one - obtain authorization code | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should be ~~~~ rather than ^^^^
docs/rest_api/authentication.rst
Outdated
You should compare the returned ``state`` against the original to ensure the request wasn't tampered with. | ||
|
||
Step two - replace with an access token | ||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As above.
docs/rest_api/authentication.rst
Outdated
Please store this data in a secure location and use it to authenticate API requests. | ||
|
||
Refreshing tokens | ||
^^^^^^^^^^^^^^^^^ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As above
docs/rest_api/authentication.rst
Outdated
|
||
.. warning:: | ||
|
||
Mautic's API library doesn't have support yet for this flow, but there's an open PR that adds support: https://github.com/mautic/api-library/pull/269 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please convert this to a link macro using the make link
command, and commit the link file.
Mautic's API library doesn't have support yet for this flow, but there's an open PR that adds support: https://github.com/mautic/api-library/pull/269 | ||
|
||
|
||
Using plain OAuth2 for the Client Credentials flow |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrap this in a vale off / vale on, also
docs/rest_api/authentication.rst
Outdated
} | ||
|
||
|
||
Authenticating the API Request |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Authenticating the API Request | |
Authenticating the API request |
} | ||
} | ||
|
||
Mautic version check |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wrap this one in a vale off / vale on.
docs/rest_api/getting_started.rst
Outdated
|
||
.. vale off | ||
|
||
API Rate limiter cache |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like this one isn't yet resolved.
Hi @MutiatBash give us a shout when you're ready for a re-review - it's helpful if you can mark the conversation resolved once you fix each item. Thanks! |
No description provided.