coldfusionscorm

Registration process isn't working in SCORM on the production environment


I am using SCORM Cloud for integrating LMS kind of application using CF. When I working with my local, the Registration functionality working fine. When I trying it in the production environment, it is throwing an 500 error.

This is the code I am using.

<cfset launchLinkRequest = {
        "expiry": 120,
        "redirectOnExitUrl": "#redirectURL#",
        "tracking": true,
        "launchAuth": {
            "type": "cookies",
            "options": {
            "ipAddress": true,
            "fingerprint": true,
            "expiry": 0,
            "slidingExpiry": 0
            }
        }
    }
/>
    
<cfhttp url="#scormBaseUrl#/registrations/#registrationId#/launchLink" method="POST" result="launchResult">
    <cfhttpparam type="header" name="Authorization" value="#authHeader#">
        <cfhttpparam type="header" name="Accept" value="application/json">
    <cfhttpparam type="header" name="Content-Type" value="application/json">

    <cfhttpparam type="body" value="#serializeJSON(launchLinkRequest)#">
</cfhttp> 

Getting this API issue in production environment, but in localhost it is working fine. This is the only issue I am getting while running it on the production site. Any folks faced this kind of issue?

500 Error


Solution

  • I finally fixed this issue. But I am not sure why this is working this way. I have added the "body" value directly to the cfhttpparam and it worked in the prod environment without any API error.

    <cfhttp url="#scormBaseUrl#/registrations/#registrationId#/launchLink" method="POST" result="launchResult">
        <cfhttpparam type="header" name="Authorization" value="#authHeader#">
            <cfhttpparam type="header" name="Accept" value="application/json">
        <cfhttpparam type="header" name="Content-Type" value="application/json">
    
        <cfhttpparam type="body" value="{
            'expiry': 120,
            'redirectOnExitUrl': '#redirectURL#',
            'tracking': true,
            'launchAuth': {
                'type': 'cookies',
                'options': {
                'ipAddress': true,
                'fingerprint': true,
                'expiry': 0,
                'slidingExpiry': 0
                }
            }
        }">
    </cfhttp>