hellohq-io / hellohq.docs

1 stars 0 forks source link

I can't create new document #189

Closed salehKhan321 closed 3 weeks ago

salehKhan321 commented 3 weeks ago

Hello, I am using the Post "https://pushdocs1.hellohq.io/v2/Documents" API to create a new document

Payload { "date": "2024-11-26T10:47:58.900Z", "validUntilDate": "2024-11-26T10:47:58.900Z", "discountNet": 0, "discountPercent": 0, "marginNet": 0, "marginPercent": 0, "currency": "EUR", "performancePeriodStartDate": "2024-11-26T10:47:58.900Z", "performancePeriodEndDate": "2024-11-26T10:47:58.900Z", "deliveryConditionId": null, "paymentConditionId": null, "contactPersonId": null, "companyId": 3014, "companyPurchaseOrderNumberId": null, "financesBankAccountId": null, "internalContactPersonId": null, "projectId": 11, "leadId": null, "documentType": "Invoice", "documentTemplateEntityId": 4, "number": "ER-1234" }

Error {"message": "An error occurred while saving the entity changes. See the inner exception for details."}

I am getting a bizarre error how can I resolve this please help image

Schaukelking commented 3 weeks ago

Hello @salehKhan321 Thanks for reaching out to us.

I just looked into your request body and can see, that your companyId is not valid. Our CompanyIds usually start from 61010. Please look for a valid companyId.

I will implement a better logging for this case! So the next time you'll get a more meaningful error message.

Kind regards, Patrick

salehKhan321 commented 3 weeks ago

Thanks, will look into it. One more thing is there any API available that will authenticate my API key which is got from my dashboard "https://pushdocs1.hellohq.io/admin/settings" like any API that returns like OK 200

Schaukelking commented 3 weeks ago

You mean a specific endpoint which validates your token?

No we don't have that. When your token is not valid, you'll get unauthorized as response

salehKhan321 commented 3 weeks ago

Ok thanks but I was trying the "https://pushdocs1.hellohq.io/v2/Authenticate/Login" my username & password both are corrects payload

{ "userName": "testing1@pushdocs.io", "password": "***" }

it continuously returns the

{"message": "Login failed"}

image

Schaukelking commented 3 weeks ago

You are missing out your backendCustomerId

image

You can find yours for example on the login page image

Via that endpoint you are getting a new token for requests. The token is linked to the user you are verifying then.

Btw. - It seems like your demo has expired. I'll contact our internal team to expand your demo duration.

salehKhan321 commented 3 weeks ago

Thanks for your help I will contact with you if I need any help