Automatic external Invoice Creation by calling SuiteCRM API

As expected:)

Did you manually copy over your .htaccess?
Have you got mod_rewrite enabled?
Have you configured it correctly - you need to have created the keys, and have an https connection for the OAuth to work:

How to use with Postman
https://docs.suitecrm.com/developer/api/developer-setup-guide/suitecrm_v8_api_set_up_for_postman/

Once you have done this, you may hit another issue in that if you copied the .htaccess over, then it won’t work correctly, as the config in the web installer is not correct. See:
https://github.com/salesagility/SuiteCRM/issues/8827

As a result, I’ve detailed the alternative URLS at the end of:
https://community.suitecrm.com/t/request-to-api-return-404-error/65657/29

-------8x-------------
I guess that I ought to put the direct URLs here as well for the latest 7.10.x and 7.11.x versions of the software. The .htaccess file relies on mod_rewrite (in apache) to carry out the following URL changes:

RewriteRule ^Api/(.*)$ - [env=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteRule ^Api/access_token$ Api/index.php/access_token [L]
RewriteRule ^Api/V8/(.*?)$ Api/index.php/V8/$1 [L]

This means that you can avoid the shortened https://mysite.com/Api/access_token and instead use the full path https://mysite.com/Api/index.php/access_token

Similarly for using the V8 Api, replace https://mysite.com/Api/V8/module and instead use the full path https://mysite.com/Api/index.php/V8/module

This way, you should still get the desired REST connection, even if the rewrite rules/.htaccess etc is messed up in some way.
-------8x-------------

1 Like