Giter Club home page Giter Club logo

mocoapp-api-docs's People

Contributors

agileapplications avatar dennisoderwald avatar dependabot[bot] avatar elfin-jmerkelbag avatar jansauer avatar manubo avatar nethad avatar pic avatar repomaa avatar sunsations avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mocoapp-api-docs's Issues

Provide a way to access timesheet data

I'd like to ask for an API endpoint that allows us to fetch timesheet data (i.e. the amount of work spent in a project grouped by the configured tasks).
The data returned by the endpoint should roughly be the same as given by Moco at https://<your_domain>.mocoapp.com/projects/<project_id>/timesheet. Preferably this endpoint should allow to specify the time range for which the data is collected, i.e. the current or the last month or even a custom range.

What do you think?

[FEATURE REQUEST] Invoice DELETE

Currently it is not possible to delete an invoice, since we work a lot with draft invoices temporarily, we want to automate this step and delete invoices.

cash_discount or discount?

Hello MocoApp Community!

Today, when we created an invoice via API, we got an error message:
cash_discount: is not a number

But in the documentation there is only "discount"

image

Handle CORS requests

Hello,

I tried to communicate with your REST api from my browser. I set up authorization header, etc. for example getting projects but I get a cors error. seems like you have to enable cors preflight requests on the server...

Request copied as fetch:

fetch("https://xxx.mocoapp.com/api/v1/projects", {"credentials":"omit","headers":{"sec-fetch-mode":"no-cors"},"referrer":"http://localhost:8080/","referrerPolicy":"no-referrer-when-downgrade","body":null,"method":"OPTIONS","mode":"cors"});

JS Console Error:

Access to XMLHttpRequest at 'https://zweischneider.mocoapp.com/api/v1/projects' from origin 'http://localhost:8080' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

If you need more details let me know.

Kindly regards

How to stop a running Timer/Task

I can start the timer for a Task if I set the hours value to 0. But how can I stop it? Currently I just could only start a new one and then delete it immediately :)

I tried it via PATCH: /projects/{project_id}/stop_timer like it's being called on the website but it didn't worked out .

[FEATURE REQUEST] Billable total

It would be great to either

  • get the billable total (showed on /projects at the top) from our Moco app.
  • get the billable items (and their total) per project (from /projects/1234/invoices)

We have build a small dashboard and would like to show that value compared to the costs set in Moco, to transparently show how we're doing :)

[FEATURE REQUEST] - Endpoint for sending invoices via email

Hey there!

I already had a nice chat with Thomas about this.

We would like to automate our invoicing. For that it would be necessary to send an invoice via API.

For now - as a workaround - we send the emails using an email service and attach the invoices manually using the /invoices/{id}.pdf endpoint.

Greetings to Switzerland,

Corvin

Create invoices as drafts

Is it planned that invoices can also be created as drafts via the API?

We have fixed-term contracts with many customers. All of these are single projects in Moco. Some customers also have several contracts (and also projects). At the beginning of the month, we create an invoice for each customer for all contracts they have.

We would like to automate this process using the API. We have already created a script for this. But we would prefer to create the invoices as drafts, as we will partly add manual items.

Thanks

Peter

[QUESTION] Tags/Labels editable for Deals

Hello there,

Is it possible to PUSH/PUT the tags/labels through the deals-endpoint?
The field isn't mentioned in the deals PUSH-documentation, so I'm guessing it's currently not possible.

The companies-endpoint has this feature so I tried it the same way for deals. I submitted the field as either labels or tags and the value being an array of strings, but no luck. Also tried it with a comma-separated list out of desperation, but nope.

If it's currently not possible at all. Could we put it down as a feature request? :)

On an almost related note: The deals-endpoint allows a field person_id (ContactsPeople for a Deal) to be pushed, but this field isn't mentioned in the PUSH-documention. It worked though.

Thanks in advance and cheers!

[FEATURE REQUEST] - Endpoint to set period lock

Hello,

we need an api endpoint so we can automatically set the period lock (Periodensperre).
I didn't found something like that in the docs. Correct me please, if i'm wrong.

Even better would be a setting in the frontend to set a time to lock all changes.
For example a new day begins (00:01) and the period lock is set 48 hours before today.
So all accounts can edit the last two days only.
This shall prevent later manipulation.

Thanks for your help!
Best regards

[FEATURE REQUEST] Invoice Reminders

As part of our automation, it would be helpful if we could create invoice reminders using the API. Because there is no bulk function via the frontend.

get projects to create activities

How to get the project and task IDs as user that does not have access to projects? In the webclient the IDs are included as JSON inside the HTML and the webclient is not using the API. But how to create activity entries through the API? GET /api/v1//projects should at least return the projects with tasks that are available for the user.

Endpoint for purchase creation does not work as described

Hello,

unfortunately the endpoint for purchase creation does not work as described in the documentation.

Our curl statement with just the required parameters gets a 500 response status code.

curl -X POST \
  'https://{domain}.mocoapp.com/api/v1/purchases' \
  -H 'Authorization: Token token=YOUR_API_KEY' \
  -H 'Content-Type: application/json' \
  -d '
    {
      "date": "2020-02-02",
      "currency": "EUR",
      "payment_method": "bank_transfer",
      "items": [
        {
          "title": "Ticket",
          "total": 30,
          "tax": 10,
          "tax_included": true,
        }
      ],
    }'

Webhook NodeJS example

I have trouble generating the correct signature with NodeJS.

Could you add an example for that?

My code so far:

const signature = crypto.createHmac('sha256', 'key')
  .update(
    JSON.stringify(event) // Tried with the whole event/body object and only { id, description }.
  )
  .digest('hex')

Edit: I've tried your example Ruby code and compared the signature with my NodeJS result – they are identical. I assume the payload is wrong. How should I convert the object to string and WHICH object to convert?

[FEATURE REQUEST] Add Soll-Ist report data

Wir würden gern automatisiert auf zu große Abweichung von Mitarbeitern im Soll-Ist Performance Report reagieren können. Beispiel hierfür wäre eine Slack Nachricht wenn der Mitarbeiter mehr als 24 Stunden in der Erfassung zu seinem Soll fehlen oder auch wenn er zu viel arbeitet.

Leider kann ich aktuell in der API nichts zu Soll-Ist Reports finden. Zwar git es die zugrunde liegenden Daten aber ein Nachbau der Auswertung ist kompliziert und Fehleranfällig.

Is it already possible to create new incoming invoices via API?

Hi there,

We plan to connect Moco to a bookkeeping software we are using. Therefore we like to create incoming invoices as "Ausgaben" in Moco via the API. It looks like the API has no endpoints for that yet or am I missing something?

Cheers
Christian

Find contact by phone number

Right now we are using Zapier to get notified in a Slack channel about our missed SIP calls.
The contact information is stored in MOCO.
It would be nice to be able to find a MOCO contact by number so that we could add this information in the Slack message.

Am I missing something or is this not possible right now?

Missing field 'hours' in GET /activities

Hey there,

first of all thanks for the awesome API implementation. I am wondering, why I can't see the field hours in the response when requesting this URL:

https://OUR_SUBDOMAIN.mocoapp.com/api/v1/activities?from=2019-01-01&page=2&project_id=PROJECT_ID&to=2019-01-31&user_id=

The fields are:

id,date,description,billed,billable,tag,remote_service,remote_id,remote_url,project/id,project/name,project/billable,task/id,task/name,task/billable,customer/id,customer/name,user/id,user/firstname,user/lastname,timer_started_at,created_at,updated_at

I checked, if there is an entry and it should be 2,25 hours.

Do I miss something?

Thanks and all the best

Andy

[FEATURE REQUEST] - endpoint for listing available deal_categories

Hello.

At the moment when we want to create a deal via api request we must supply deal_category_id but regrettably there is no option available to retrieve the availabe deal_category_id's via api.

We have to go to the admin dashboard and copy the deal_category_id we want to use manually.

Maybe an endpoint can be created to list all available categories (something like /deals/categories or /deals/deal_categories would be great).

[FEATURE REQUEST] Endpoints for planned billing

Hi Moco Team,

as part of our planned automation of accounting, we would like to use the API to "plan billing".
(In German "Abrechnung planen").
I am looking forward to your feedback if this feature makes sense for you or not?

Greetings Peter

[Bug] Invoice: service period Validation

The fields 'service_period_from' and 'service_period_to' must always be set together. If only one of the fields is set, an error 500 occurs.

Here a 422 message should be returned.

Server responds with timeout

Hi again,

due to the fact, that the API is responding in shards by 100 entries, but the data I need are much more, I calculated the number of pages (iterations) I need to get the full data set. I am reading the header "x-total". So in this example I need 81 iterations, to get all data:

~/p/s/m/moco_api git:master ❯❯❯ bundle exec bin/moco_api activities --from=2019-02-01 --to=2019-02-28 --export_csv

After each iterations request I set a sleep(5). That are 5 seconds to wait. Unfortunately I receive this after the first 8 to 18 iterations:

Iterations: 81 ................bundler: failed to load command: bin/moco_api (bin/moco_api) Faraday::TimeoutError: Failed to open TCP connection to BLABLA.mocoapp.com:443 (Operation timed out - connect(2) for "BLABLA.mocoapp.com" port 443)

I am aware, that you are limiting the request by writing in the docs:

You can expect to be able to fire 15 requests within a time frame of 15 seconds. If you exceed this limit, the server responds with 429 Too Many Requests.

But in my case I don't fire one request in one second or 15 in 15 seconds and I don't get a 429 code.

Do I miss something here? It was last night 30.04.2019 between 10:00 pm and 01.05.2019 01:00 am.

Additional question: is there a way to avoid the 100 lines result per request?

Thanks a lot for any advise or help.

Cheers

Andy (sumcumo.com)

[FEATURE REQUEST] Mark invoice items as billed

As in the Internal API for the web app, it would be desirable for further automation if you could attach the "expense_ids" to the item so that they are automatically marked as billed.

As a workaround I can use the endpoint POST /projects/{id}/expenses/disregard, but there is the risk that if the invoice is cancelled, the expense items will not be billed again because there is no reference for Moco.

Therefore we are currently using the internal API to create the invoices.

POST schedules with am and pm set to false causes a 500

Wenn POSTing a schedule with both parameters am and pm set to false causes the server to respond with status code 500.

I'm not sure whether this is working as intended (as setting both parameters to false for a single day makes absolutely no sense) but at least in my experience 500s are rarely intended.

*   Trying 2a03:b240:100::4:443...
* TCP_NODELAY set
* Connected to somedomain.mocoapp.com (2a03:b240:100::4) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/certs/ca-certificates.crt
  CApath: /etc/ssl/certs
* SSL connection using TLSv1.3 / TLS_AES_128_GCM_SHA256
* ALPN, server accepted to use h2
* Server certificate:
*  subject: CN=*.mocoapp.com
*  start date: Dec 31 20:50:39 2020 GMT
*  expire date: Mar 31 20:50:39 2021 GMT
*  subjectAltName: host "somedomain.mocoapp.com" matched cert's "*.mocoapp.com"
*  issuer: C=US; O=Let's Encrypt; CN=R3
*  SSL certificate verify ok.
* Using HTTP2, server supports multi-use
* Connection state changed (HTTP/2 confirmed)
* Copying HTTP/2 data in stream buffer to connection buffer after upgrade: len=0
* Using Stream ID: 1 (easy handle 0x555d08c12100)
> POST /api/v1/schedules?date=2020-12-23&absence_code=5&user_id=someuserid&am=1&pm=1&symbol=11&overwrite=1 HTTP/2
Host: somedomain.mocoapp.com
accept: */*
authorization: Token token=sometoken

* Connection state changed (MAX_CONCURRENT_STREAMS == 250)!
< HTTP/2 200 
< cache-control: max-age=0, private, must-revalidate
< content-type: application/json; charset=utf-8
< etag: W/"48206902a655f839d0f25d0ea391f7dd"
< referrer-policy: strict-origin-when-cross-origin
< vary: Origin
< x-content-type-options: nosniff
< x-download-options: noopen
< x-frame-options: SAMEORIGIN
< x-permitted-cross-domain-policies: none
< x-request-id: 461ffdc3-f568-4737-bb72-7c360645a81c
< x-runtime: 0.045808
< x-xss-protection: 1; mode=block
< content-length: 340
< date: Mon, 18 Jan 2021 08:55:43 GMT
< 
* Connection #0 to host somedomain.mocoapp.com left intact

Company type in deal endpoint

Hi,

currently when you request a deal object over the api with a company attached the type will be returned as company::{company_type} (eg. "company::customer").

Shouldn't this just be customer?

https://{domain}.mocoapp.com/api/v1/deals/{id}'

{
  "id": "",
  ....
  "company": {
    "id": "",
    "type": "company::customer",
    "name": "Beispiel GmbH"
  },
}

Here is the example response from the api docs
https://github.com/hundertzehn/mocoapp-api-docs/blob/master/sections/deals.md

  "id": 123,
  "name": "Website V2",
  "status": "pending",
  "reminder_date": "2017-05-19",
  "money": 61000,
  "currency": "CHF",
  "info": "Interesting Lead!",
  "custom_properties": {
    "Type": "Website"
  },
  "user": {
    "id": 933593033,
    "firstname": "Nicola",
    "lastname": "Piccinini"
  },
  "company": {
    "id": 760260535,
    "name": "Beispiel AG",
    "type": "Customer"
  },
  "category": {
    "id": 12,
    "name": "Angebot",
    "probability": 30
  },
  "created_at": "2018-10-17T09:33:46Z",
  "updated_at": "2018-10-17T09:33:46Z"
}

fetch fails with 401

Hi,

the documentation describes curl commands to retrieve API data and these commands are working properly. What is weird though is that fetch responds with an 401 error with exactly the same data as in curl.

works

curl -X GET \
  'https://OURDOMAIN.mocoapp.com/api/v1/projects.json' \
  -H 'Authorization: Token token=OURNICETOKEN'

fails with 401

const res = await fetch('https://OURDOMAIN.mocoapp.com/api/v1/invoices', {
        headers: {
          Authorization: 'Token token=OURNICETOKEN'
        },
        mode: 'no-cors'
      })

Any idea where I am heading in the wrong direction?

Thanks,
Harald

English language

is there any plan to have the MocoApp translated to english?
Is there any way we can help you do that?

[BUG] Holiday hours not set when created via curl

Hello,
we noticed when creating holiday credits, via the api, that the hours property was not set after creating the holiday entry.

When created via curl request:

curl -X POST 'https://{domain}.mocoapp.com/api/v1/users/holidays' -H 'Authorization: Token token={TOKEN}' -H 'Content-Type: application/json' -d '{ "user_id": 1234, "year": 2020, "title": "Holiday credits", "hours": 20 }'

Response:

{
  "id": 1234,
  "year": 2020,
  "title": "Holiday credits",
  "days": 2.5,
  "hours": 0,
  "user": {
    "id": 1234,
    "firstname": "test",
    "lastname": "test"
  },
  "created_at": "2020-12-23T10:37:26Z",
  "updated_at": "2020-12-23T10:37:26Z"
}

When the holiday is created over the web app, then retrieved over the api, the the data looks like this:

{
  "days": 2.5,
  "hours": 20,
  "id": 1234,
  "title": "Holiday credits",
  "user": {
    "id": 12345,
    "firstname": "test",
    "lastname": "test"
  },
  "year": 2020,
  "created_at": "2020-12-24T10:43:11Z",
  "updated_at": "2020-12-24T10:43:11Z"
}

Thank you and merry christmas :)

Example for an Activities-POST-Request is not working

The POST-Request for creating an activity is not working.
Calling Curl via console is triggering Field-Errors for "date" and "description" like...

"date":["muss ausgefüllt werden","ist nicht gültig"],
"description":["ist zu kurz (weniger als 3 Zeichen)"]

Calling the API via POSTMAN we will get only a "301 - Moved permanently"

Is there anything we didnt recognized? Thanks in advance.

Here the curl request:
curl -X POST 'https://nfq.mocoapp.com/api/v1/activities'
-H "Authorization: Token token={moco_api_key}"
-H 'Content-Type: application-json'
-d '{"date": "2019-02-04", "description": "Moco Api test with more than 3 characters.", "hours": 1.0, "project_id": 944739918, "task_id": 1729356}'

[FEATURE REQUEST] Project Expense Recurring Interval

Unfortunately, it is not possible to see from a Project Expense from which recurring expense it was created or with which interval what would be very important for the calculation of the service period.

An additional service that is calculated every three months has a different service period than a monthly one.

[FEATURE REQUEST] - endpoints for planned holidays and working hours schedules

Hi!

We are using data from your api to show some personalized information on internal dashboard.
And we would like to show three pieces of information that - if I understand correctly - are a bit difficult/impossible to get:

  1. Status of current worked hours per user (if given user worked too much or too little in comparison to due hours at this day). Here if I understand well I could of course iterate over all activities and count hours manually, but it would be a tedious task that I would need to schedule to some cron once a day, probably?
  2. Date of next planned holiday ( •ᴗ• ) - you added recently (26467e7) an endpoint for summary of holidays available to the user given year, but I can't get just get dates of planned holidays for given user, can I? Again, I would need to iterate through all schedules, filter by user, by name "Urlaub" and then find the closest, is that right?
  3. If we have users that work part time (for example work only Monday to Wednesday every week), I can not get this schedule (like week days/hours were user is supposed to be at the office), can I? I can only get weekly hour target for given user?

So my question is if I understand correctly that at current state of the api I can get information from point 1 and 2 only by manually iterating through Activities/Schedules respectively and I can't get information from point 3 at all?
And if my understanding indeed is correct, would you consider adding endpoints that would make getting those information in more straightforward way? :)

Thanks in advance for your help!
Best regards from Aachen!

make clickup valid as remote_service

we are trying to customize the moco browser extension to work with clickup. We forked the extension and customized it already. The only issue currently is that the remote_service we send to the activites api call sends invalid "remote_service" back. can you please activate clickup as a valid value in the api? otherwise we have to mock this service as trello or something else...

if you also build in the link to clickup tasks, the expected urls are like:
https://app.clickup.com/t/{task_id}

[BUG] Contact on the invoice is now always set to the API user

When we generated an invoice without set the contact, the project manager was displayed on the invoice or the contact of the customer.

Now the API user who generates the invoice always appears. I have also not found a variable in the API documentation to change this again.

It would be great if it would just use the project manager like before (if not set).

Strange behaviour POSTing the same schedule twice with different am/pm settings

I POSTed the same schedule twice, once with both am and pm set to true and afterwards once with am set to false (and overwrite to true as well) instead. When fetching the list of schedules I receive two schedules which are identical except for their id - the schedule has not actually been overwritten (which is what I expected) and the first schedule's am is reported to be false as well.

The schedule has the following properties with were passed to the server via the URL:

{
  "date": "2020-10-01",
  "absence_code": 5,
  "user_id": 123456,
  "am": true,
  "pm": true,
  "comment": "Automated by JME",
  "symbol": 11,
  "overwrite": true
}

What follows is a short rundown of what I did in chronological order:

  1. I POSTed the schedule for the first time. The server returns the correct object.
  2. I checked the GUI to see whether the schedule pops up in the calendar. It did.
  3. I POSTed the same schedule again but this time with its am set to false. The server responds the proper object which is the same as before except for id, am, created_at and updated_at.

In case you need more information feel free to ask.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.