代码之家  ›  专栏  ›  技术社区  ›  Rob H

如何使用Account\u Partner\u业务api

  •  1
  • Rob H  · 技术社区  · 7 年前

    我正在尝试使用此API: http://sldn.softlayer.com/reference/services/SoftLayer_Account_Partner_Business/getObject

    任何通话都会导致

    SoftLayer.exceptions.SoftLayerAPIError: SoftLayerAPIError(SoftLayer_Exception): Object does not exist to execute method on. (SoftLayer_Account_Partner_Business::getObject)

    我假设这表明我需要一个输入参数,尽管API文档在这方面并不明确。

    如果我传入使用此api检索到的帐户ID: http://sldn.softlayer.com/reference/services/softlayer_account/getObject

    SoftLayer.exceptions.SoftLayerAPIError: SoftLayerAPIError(SoftLayer_Exception_ObjectNotFound): Unable to find object with id of '1314767'.

    Account\u Partner\u Business/getObject调用的正确参数是什么?我如何找到它?

    谢谢

    1 回复  |  直到 7 年前
        1
  •  1
  •   Ruber Cuellar Valenzuela    7 年前

    首先,您需要使用此方法:

    休息请求: https://$user:$apiKey@api.softlayer.com/rest/v3/SoftLayer_Account/getBusinessPartner

    替换: $用户 $apiKey 用你自己的证件

    它将返回一个响应,应该使用id属性从中调用 SoftLayer_Account_Partner_Business::getObject

    休息请求:

    http://sldn.softlayer.com/reference/services/SoftLayer_Account_Partner_Business/12345/getObject
    

    注: 12345 是上面响应的id