0

我迷路了,我希望有人可能以前做过这方面的工作。所以 Coupa 有它的 API: https ://coupadocs.atlassian.net/wiki/display/integrate/Users+API

我能够与相应的经理一起检索用户信息。示例响应:

https://unknownserver-test.coupahost.com/api/users?employee-number=10003323

[
  {
    "id": 2756,
    "created-at": "2017-03-30T09:29:19-05:00",
    "updated-at": "2017-03-31T04:30:53-05:00",
    "login": "user1.user1",
    "email": "staging23@coupa.com",
    "purchasing-user": false,
    "expense-user": false,
    "sourcing-user": false,
    "inventory-user": false,
    "employee-number": "10003323",
    "phone-work": null,
    "phone-mobile": null,
    "firstname": "user1",
    "lastname": "user1",
    "fullname": "user1 user1",
    "api-user": false,
    "active": false,
    "salesforce-id": null,
    "account-security-type": 0,
    "authentication-method": "coupa_credentials",
    "sso-identifier": null,
    "default-locale": null,
    "default-account": null,
    "business-group-security-type": null,
    "edit-invoice-on-quick-entry": false,
    "avatar-thumb-url": null,
    "mention-name": "user1user1",
    "company-employee-id": "10003323",
    "netsuite-employee-id": "10003323",
    "subsidiary": {
      "id": 1592,
      "external-ref-num": null,
      "external-ref-code": "company North America:1"
    },
    "job-title": {
      "id": 2591,
      "external-ref-num": null,
      "external-ref-code": "VP, Sales"
    },
    "employee-type": "",
    "default-expense-region": "",
    "default-geo-spend": "",
    "notes": "",
    "exclude-from-autosarf": "",
    "roles": [
      {
        "id": 10,
        "name": "Expense User"
      }
    ],
    "manager": {
      "id": 838,
      "login": "john.doe",
      "email": "staging@coupa.com"
    },
    "default-currency": {
      "id": 1,
      "code": "USD"
    },
    "department": {
      "id": 342,
      "name": "Sales - Exec:176"
    },
    "expenses-delegated-to": [],
    "can-expense-for": [],
    "content-groups": [],
    "account-groups": [],
    "approval-groups": [],
    "working-warehouses": [],
    "inventory-organizations": [],
    "created-by": {
      "id": 2748,
      "login": "user1 creator",
      "email": "user1.creator@company.com"
    },
    "updated-by": {
      "id": 2748,
      "login": "user1 creator",
      "email": "user1.creator@company.com"
    }
  }
]  

我试过的是这些:

https://unknownserver-test.coupahost.com/api/users?user[manager][id]=838&return_object=shallow
https://unknownserver-test.coupahost.com/api/users?manager[id]=838&return_object=shallow
https://unknownserver-test.coupahost.com/api/users?users[user][manager][id]=838&return_object=shallow
4

1 回答 1

0
https://{{URL PREFIX}}.{{HOST}}.com/api/users?manager_id=838&return_object=shallow

如果您只需要用户的 ID,您将获得更好的性能return_object=limited

如果返回的用户超过 50 个,则必须使用偏移量查询参数进行分页。

于 2017-08-15T23:31:27.667 回答