SOLVED! SuiteCRM + n8n Integration via OAuth2 API - Complete Guide

Problem: Couldn’t connect n8n with SuiteCRM - getting 404, 500, ā€œunsupported_grant_typeā€ errors

AFTER 3 DAYS OF STRUGGLE - HERE’S THE COMPLETE SOLUTION:

:wrench: PROBLEMS ENCOUNTERED AND SOLUTIONS:

1. ERROR 500: Missing OAuth2 Keys

bash

THIS STEP IS CRITICAL! docker exec -it suitecrm bash cd /bitnami/suitecrm/public/legacy/Api/V8/OAuth2/ openssl genrsa -out private.key 2048 openssl rsa -in private.key -pubout -out public.key chmod 600 private.key public.key chown daemon:daemon private.key public.key exit docker-compose restart suitecrm

2. ERROR 404: Wrong Endpoint

DON’T use: /api/oauth/token or /rest/v1/oauth/token
USE: /legacy/Api/access_token

3. ERROR 400: Wrong Configuration

Content-Type MUST be: application/vnd.api+json (NOT application/json )

:rocket: EXACT n8n CONFIGURATION:

Step 1: Create OAuth2 Client in SuiteCRM

  • Go to Admin → OAuth2 Clients
  • Create ā€œPassword Grantā€ client
  • Note: Client ID and Client Secret

Step 2: n8n HTTP Request Node - Get Token

text

URL: http://suitecrm:8080/legacy/Api/access_token Method: POST Headers: - Content-Type: application/vnd.api+json - Accept: application/vnd.api+json Body (JSON): { ā€œgrant_typeā€: ā€œpasswordā€, ā€œclient_idā€: ā€œYOUR_CLIENT_IDā€, ā€œclient_secretā€: ā€œYOUR_CLIENT_SECRETā€, ā€œusernameā€: ā€œadminā€, ā€œpasswordā€: ā€œAdmin123ā€ }

Step 3: Use the Token

text

URL: http://suitecrm:8080/Api/V8/Modules Method: GET Headers: - Content-Type: application/vnd.api+json - Accept: application/vnd.api+json - Authorization: Bearer {{ $json.access_token }}

:bulb: KEY DISCOVERIES:

  1. SuiteCRM OAuth2 is VERY particular about formats
  2. Content-Type MUST be application/vnd.api+json (not regular JSON)
  3. Endpoint is /legacy/Api/access_token in many installations
  4. OAuth2 keys MUST be generated manually - they don’t auto-create

:dart: WORKING ENDPOINTS TO TEST:

  • /Api/V8/Modules - List available modules
  • /Api/V8/Accounts - Get accounts
  • /Api/V8/Contacts - Get contacts
  • /Api/V8/Leads - Get leads

:stopwatch: TIME INVESTMENT: 3 days → Now works in 5 minutes!

DON’T GIVE UP! The integration is possible, just very poorly documented. Once configured, it works perfectly.

Hope this saves someone else the headache! :face_with_head_bandage:→:blush:

suitecrm #n8n #API #OAuth2 #Integration #Automation

3 Likes

Thanks for the detailed write-up.

As for the Bitnami image:

There are plenty of issues, the biggest might just be: How to upgrade a Bitnami installation?

1 Like

LOL I’ve been working with the v8 api daily for the last couple of months I feel your pain. Wait till you want to do something just a little bit complicated with it! Good for you, yes it’s poorly documented and because of that Chatgpt hallucinates most of the solutions and drives you crazy down rabbit holes that don’t exist! Good luck. You might find you have to be creative with the way you get data based on the limitations of the filter. That was my biggest challenge.

1 Like

Great job @MAx1 it contributes for sure to the community, so I’m sure @BastianHammer would gives us also and advice for starter people to connect n8n into SuiteCRM? :smiley: or at least a clue where to start readding to achived this goal ? thanks in advance!! you guys are cracks and I would be glad to learn from you. thanks again!

1 Like

@MAx1

I don’t use the bitnami image I must admit (and given the $64k price tag for their secured images I’m glad), however for n8n I do just use the plugin to connect to SuiteCRM which worked just fine for me, there is also a plugin floating around for Suite to send back to n8n as well (@BastianHammer had it in one of his posts here).

Regards

Mark

Hello Jorge,

basically, whatever fits well for you.
I’ve integrated SuiteCRM with Python, PHP, n8n, activepieces, make (and Postman for testing) - since it’s a fairly standard JSON API, it all works smoothly.

I usually like to use the docs:

You can also checkout my playlist on SuiteCRM (and mostly n8n) integration:

1 Like