通过ColdFusion访问PokitDok API

时间:2017-05-04 15:55:08

标签: json coldfusion

我正在尝试访问PokitDok's eligibility API,它需要以下内容:

client.eligibility({
    member: {
        birth_date: "1970-01-25",
        first_name: "Jane",
        last_name: "Doe",
        id: "W000000000"
    },
    provider: {
        first_name: "JEROME",
        last_name: "AYA-AY",
        npi: "1467560003"
    },
    trading_partner_id: "MOCKPAYER"
})

我写的ColdFusion如下:

<cfset SubmissionFields = {
    "member": {
       birth_date: "1970-01-25",
        "first_name": "Jane",
        "last_name": "Doe",
        "id": "W000000000"
    },
    "provider": {
        "first_name": "JEROME",
        "last_name": "AYA-AY",
        "npi": "1467560003"
    },
    "trading_partner_id": "MOCKPAYER"
} />


<cfhttp url="https://platform.pokitdok.com/oauth2/token/eligibility/" username="xxxx" password="xxxx" method="post" result="httpResponse" timeout="60">
    <cfhttpparam type="header" name="Content-Type" value="application/json" />
    <cfhttpparam type="body" value="#serializeJSON(SubmissionFields)#">
</cfhttp>

我在哪里放置client.eligibility函数调用(如果是这样的话)?

谢谢!

1 个答案:

答案 0 :(得分:2)

PokitDok有一个开源Java客户端,它可以集成到你的Coldfusion项目中,因为它在JVM中运行。这是他们的Java客户端:

https://github.com/pokitdok/pokitdok-java

以下是另外两篇StackOverflow帖子,介绍如何将现有Java库集成到Coldfusion项目中:

1)How do you use java files in Coldfusion

2)Include Java Files into Coldfusion

(联盟编辑:我是pokitdok的技术传播者)