Hello all,
Please I need help, it’s more than 20 hours and i’m struggling with this :
I have a suitecrm installed in my vm machine (ubuntu server), this suitecrm is a docker image from bitnami, and the binded data are in a folder which is shared to windows thgought vbox.
The problem is related to the API V8 which doesn’t work like the docs say, I have searched a lot either inside this forum or outside of it and the only thing I was able to solve was getting the JWT token. But the requests don’t work at all.
version :
‘suitecrm_version’ => ‘7.11.13’,
Steps I have done till now :
> 1) Created client credentials grant : Done
> 2) composer install : Done
> 3) Rebuild .htaccess File : Done
> 4) open a terminal and go to `{{suitecrm.root}}/Api/V8/OAuth2` : Done
> 5) openssl genrsa -out private.key 2048 : Done
> 6) openssl rsa -in private.key -pubout -out public.key : Done
> 7) sudo chmod 600 private.key public.key : Doesn't work , neither as user nor as www-data as user nor as root nor as vboxsf group
> 8) sudo chown www-data:www-data p*.key : same thing, doesn't work
> 9) go to Api/Core/Config/ApiConfig.php and find "const OAUTH2_ENCRYPTION_KEY". : Done
> 10) Now update its value with generating a new one using `base64_encode(random_bytes(32))` : Done
> 11) http://192.168.1.6/Api/access_token => 500 internal server error
> 12) http://192.168.1.6/api/oauth/access_token => 200 OK, from here I can get jwt token
> 13) http://192.168.1.6/Api/docs/swagger/swagger.json => works
> 14) http://192.168.1.6/Api/module/Accounts => 404 not found
> 15) http://192.168.1.6/Api/module/accounts => 404 not found
> 16) http://192.168.1.6/Api/modules/Accounts => 404 not found
> 17) http://192.168.1.6/api/module/Accounts => 401 unauthorized :
{
"error": "access_denied",
"message": "The resource owner or authorization server denied the request.",
"hint": "Error while decoding to JSON"
}
> 18) http://192.168.1.6/api/V8/module/Accounts => 401 unauthorized (same response)
> 19) http://192.168.1.6/Api/V8/module/Accounts => 500 internal server error
> 20) http://192.168.1.6/Api/V8/modules/Accounts => 500 internal server error
> 21) http://192.168.1.6/V8/module/Accounts => 404 Not Found (well that's normal because it should start with Api or api i don't know)```
And in Authorization header when i exchange bearer with Bearer i get :
http://192.168.1.6/api/V8/modules/Accounts => {
"errors":[
{
"code": 8000,
"title": "[SuiteCRM] [API] [Not Found] [Resource]",
"detail":{
},
"source":{
"pointer": null,
"parameter": null
},
"status": 404
},
{"id": "1", "links":{"about": null }, "status": 404, "code": 8000,…}
],
"meta":{
"suiteapi":{
"major": 8,
"minor": 0,
"patch": 0,
"stability": "ALPHA"
}
},
"jsonapi":{
"version": "1.0"
}
}
Please I need help asap thanks
.htaccess:
RedirectMatch 403 (?i).*\.log$
RedirectMatch 403 (?i)/+not_imported_.*\.txt
RedirectMatch 403 (?i)/+(soap|cache|xtemplate|data|examples|include|lo
g4php|metadata|modules|vendor)/+.*\.(php|tpl)
RedirectMatch 403 (?i)/+emailmandelivery\.php
RedirectMatch 403 (?i)/+.git
RedirectMatch 403 (?i)/+.cache/
RedirectMatch 403 (?i)/+tests
RedirectMatch 403 (?i)/+RoboFile\.php
RedirectMatch 403 (?i)/+composer\.json
RedirectMatch 403 (?i)/+composer\.lock
RedirectMatch 403 (?i)/+upload
RedirectMatch 403 (?i)/+custom/+blowfish
RedirectMatch 403 (?i)/+cache/+diagnostic
RedirectMatch 403 (?i)/+files\.md5$
<IfModule mod_rewrite.c>
Options +SymLinksIfOwnerMatch
Options -Indexes
Options -MultiViews
RewriteEngine On
RewriteBase /
RewriteRule ^cache/jsLanguage/(.._..).js$ index.php?entryPoint=jsl
ang&modulename=app_strings&lang=$1 [L,QSA]
RewriteRule ^cache/jsLanguage/(\w*)/(.._..).js$ index.php?entryPoi
nt=jslang&modulename=$1&lang=$2 [L,QSA]
# --------- DEPRECATED --------
RewriteRule ^api/(.*)$ - [env=HTTP_AUTHORIZATION:%{HTTP:Authorizat
ion}]
RewriteRule ^api/(.*?)$ lib/API/public/index.php/$1 [L]
# -----------------------------
RewriteRule ^Api/(.*)$ - [env=HTTP_AUTHORIZATION:%{HTTP:Authorizat
ion}]
RewriteRule ^Api/access_token$ Api/index.php/access_token [L]
RewriteRule ^Api/V8/(.*?)$ Api/index.php/V8/$1 [L]
</IfModule>
<IfModule mod_headers.c>
Header unset ETag
FileETag None
</IfModule>
<IfModule mod_headers.c>
Header unset X-Powered-By
Header always unset X-Powered-By
</IfModule>
<IfModule mod_expires.c>
ExpiresActive on
ExpiresDefault "access plus 1 month"
# CSS
ExpiresByType text/css "access plus 1 year"
# Data
ExpiresByType application/atom+xml "access plus 1 hour"
ExpiresByType application/rdf+xml "access plus 1 hour"
ExpiresByType application/rss+xml "access plus 1 hour"
ExpiresByType application/json "access plus 0 seconds"
ExpiresByType application/ld+json "access plus 0 seconds"
ExpiresByType application/schema+json "access plus 0 seconds"
ExpiresByType application/geo+json "access plus 0 seconds"
ExpiresByType application/xml "access plus 0 seconds"
ExpiresByType text/calendar "access plus 0 seconds"
ExpiresByType text/xml "access plus 0 seconds"
# Favicon
ExpiresByType image/x-icon "access plus 1 week"
# HTML
ExpiresByType text/html "access plus 0 seconds"
# JavaScript
ExpiresByType application/javascript "access plus 1 year"
ExpiresByType application/x-javascript "access plus 1 year"
ExpiresByType text/javascript "access plus 1 year"
# Markdown
ExpiresByType text/markdown "access plus 0 seconds"
# Media files
ExpiresByType audio/ogg "access plus 1 month"
ExpiresByType image/bmp "access plus 1 month"
ExpiresByType image/gif "access plus 1 month"
ExpiresByType image/jpeg "access plus 1 month"
ExpiresByType image/jpg "access plus 1 month"
ExpiresByType image/png "access plus 1 month"
ExpiresByType image/svg+xml "access plus 1 month"
ExpiresByType image/webp "access plus 1 month"
ExpiresByType video/mp4 "access plus 1 month"
ExpiresByType video/ogg "access plus 1 month"
ExpiresByType video/webm "access plus 1 month"
# Fonts
ExpiresByType font/eot "access plus 1 month"
ExpiresByType font/opentype "access plus 1 month"
ExpiresByType font/otf "access plus 1 month"
ExpiresByType application/x-font-ttf "access plus 1 month"
ExpiresByType font/ttf "access plus 1 month"
ExpiresByType application/font-woff "access plus 1 month"
ExpiresByType application/x-font-woff "access plus 1 month"
ExpiresByType font/woff "access plus 1 month"
ExpiresByType application/font-woff2 "access plus 1 month"
ExpiresByType font/woff2 "access plus 1 month"
# Other
ExpiresByType text/x-cross-domain-policy "access plus 1 week"
</IfModule>
<IfModule mod_headers.c>
Header set X-Content-Type-Options "nosniff"
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [R=301,L]
</IfModule>
# END SUITECRM RESTRICTIONS