GraphQL API queries - Company Filings

Hi,

We are currently working on company filings API to download reports of the companies based on OrganizationId. I would like to know if its possible to pass multiple OrganizationId as part of single graphql query. If yes, kindly share an example of the query.

Thanks,

Ajitha

Answers

  • Jirapongse
    Jirapongse ✭✭✭✭✭

    @ajitharani.nallathambiganesan

    Thank you for reaching out to us.

    You can try the IN operator.

    OrganizationId: {IN: $OrganizationId}
    

    For example:

    {
    "query": "query FinancialFiling($OrganizationId: [Long!], $FilingDateFrom: DateTime!, $FilingDateTo: DateTime!, $LanguageId: Long) {\n FinancialFiling(filter: {AND: [{FilingDocument: {Identifiers: {OrganizationId: {IN: $OrganizationId}}}}, {FilingDocument: {DocumentSummary: {FilingDate: {BETWN: {FROM: $FilingDateFrom, TO: $FilingDateTo}}}}}]}, sort: {FilingDocument: {DocumentSummary: {FilingDate: DESC}}}, limit: 10) {\n FilingOrganization {\n Names {\n Name {\n OrganizationName(filter: {AND: [{LanguageId: {EQ: $LanguageId}}, {NameTypeCode: {EQ: "LNG"}}]}) {\n Name\n }\n }\n }\n }\n FilingDocument {\n Identifiers {\n OrganizationId\n Dcn\n }\n DocId\n FinancialFilingId\n DocumentSummary {\n DocumentTitle\n FilingDate\n DocumentType\n SubmissionTypeDescription {\n Value\n }\n HighLevelCategory\n MidLevelCategory\n FeedName\n PageCount\n SizeInBytes\n OriginalFilename\n }\n FilesMetaData {\n FileName\n MimeType\n }\n }\n }\n}\n",
    "variables": {
    "OrganizationId": [
    "4295861160",
    "4295904307"
    ],

    "LanguageId": "505062",
    "FilingDateFrom": "2020-01-01T00:00:00Z",
    "FilingDateTo": "2020-12-31T00:00:00Z"
    }
    }

  • @Jirapongse Thanks for the response. It worked. May I pls know how many org ids can be passed like this in single request?

  • Jirapongse
    Jirapongse ✭✭✭✭✭

    @ajitharani.nallathambiganesan

    The document doesn't mention anything about the limit of the IN operator but it limits the size of query to 150 KB.