Skip to main content
AskingForHelp
New Member
Jan 5, 2024 3:42 PM UTC
Solved

API command to register a license

Hello Community

 

I am attempting to use the FortiOS API to apply a license. The device is a FortiWifi 80F with Firmware 7.2.6.

I am attempting to apply the Advanced Malware Protection Free Trial, for testing purposes.

From help with the Fortinet Developer Network I have seen this command:

 

 

curl -X 'POST' \   'https://192.168.20.1/api/v2/monitor/registration/forticare/add-license?access_token=xp40rkkhqcbfyr8Nq96H9G7H43q0f4' \   -H 'accept: application/json' \   -H 'Content-Type: application/json' \   -d '{   "registration_code": "STRING" }'

 

 

I am not sure what the registration_code value should be. I visited support.fortinet.com to gather the license key I wish to apply. It downloads as a .lic file. There is text in there but nothing matches the registration code. I have tried to insert the contract number as the string but this did not work.

Where can I find the registration code?

Am I using the wrong endpoint?

Appreciate it

saneeshpv_FTNT
Staff
Jan 8, 2024 6:38 AM UTC

Hi @AskingForHelp 

 

The FortiGate can be registered in either the FortiGate GUI or the FortiCloud support portal and the API above is to register a new license to the the support portal and this requires a Service Registration code which normally you will receive from the Fortinet Sales Department.

 

https://docs.fortinet.com/document/fortigate/7.4.1/administration-guide/893081/registration 

"The service contract number is needed to complete registrations on the FortiCloud support portal. You can find this 12-digit number in the email that contains your service registration document (sent from do-not-reply-contract@fortinet.com) in the service entitlement summary."

 

May I know how did you get the License file from the Fortinet portal? Have you registered the License already using the Registration code ?

 

If that is the case License will be automatically updated to the device once it has internet access. Usually it take sometime to update the license once the internet access is available.

 

Best Regards,
Saneesh

 

 

4 replies

Anthony_E
Staff
Staff
Jan 8, 2024 5:41 AM UTC

Hello,


Thank you for using the Community Forum. I will seek to get you an answer or help. We will reply to this thread with an update as soon as possible.


Thanks,

Best Regards
saneeshpv_FTNT
Staff
Staff
Jan 8, 2024 6:38 AM UTC

Hi @AskingForHelp 

 

The FortiGate can be registered in either the FortiGate GUI or the FortiCloud support portal and the API above is to register a new license to the the support portal and this requires a Service Registration code which normally you will receive from the Fortinet Sales Department.

 

https://docs.fortinet.com/document/fortigate/7.4.1/administration-guide/893081/registration 

"The service contract number is needed to complete registrations on the FortiCloud support portal. You can find this 12-digit number in the email that contains your service registration document (sent from do-not-reply-contract@fortinet.com) in the service entitlement summary."

 

May I know how did you get the License file from the Fortinet portal? Have you registered the License already using the Registration code ?

 

If that is the case License will be automatically updated to the device once it has internet access. Usually it take sometime to update the license once the internet access is available.

 

Best Regards,
Saneesh

 

 

AskingForHelp
New Member
Jan 8, 2024 10:04 PM UTC

Hello saneeshpv_FTNT

This detail is a great help! I received the license file from the Fortinet Support site under Product List, FortiGuard Trial.

Is it true then, that even if I do not use this API command but only use the web GUI, the license will be applied automatically whenever the fortinet firewall next connects to the internet?

fortimatter
New Member
Apr 22, 2025 3:57 PM UTC

Curious to know if this is still the case. Trial/Eval license(s) cannot be registered via API?

Thought Leadership. Security Summit. Thursday, November 12th, PGA National Resort, Palm Beach Gardens, FL.
Security Operations Summit: Modernize SecOps. Operate AI-Native.AMER: November 4 | 9:00 AM PST. India and SAARC: November 5 | 10:00 AM IST. EMEA: November 5 | 10:30 AM CET. APAC: November 5 | 11:00 AM SGT