Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Support for Creating Contacts with Optional Company Information #61

Merged
merged 7 commits into from
Dec 19, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Updated README
CCirbo committed Dec 19, 2024
commit e86fa4ce6962d67ae8cd038eda5154eaabd72b83
37 changes: 37 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -644,6 +644,43 @@ Status: 201 created
}

```
#### Create a contact with a company name from the dropdown box
Request:
```
POST api/v1/users/2/companies/2/contacts

Authorization: Bearer Token - put in token for user

raw json body with all fields:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps adding some clarification on which of the fields are absolutely required. I saw in the tests you were using a minimal params when creating. So while it is very helpful to have the full JSON as an example, having some information on which fields will trigger the 404 error if not included can clear that up. For example, first and last name are required while email is an optional field.

Copy link
Collaborator

@reneemes reneemes Dec 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for pointing this out. Due to how the DB is currently set up only the first name, last name, and company ID id needed, depending on which URL being used. The Read Me currently states that unique first and last names are required, but does not specify that the new route needs a company ID. I can update that to make it more apparent.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Read Me has been updated.


{
"data": [
{
"id": "1",
"type": "contacts",
"attributes": {
"first_name": "Jane",
"last_name": "Doe",
"company_id": 2,
"email": "",
"phone_number": "",
"notes": "",
"user_id": 2,
"company": {
"id": 2,
"name": "Future Designs LLC",
"website": "https://futuredesigns.com",
"street_address": "456 Future Blvd",
"city": "Austin",
"state": "TX",
"zip_code": "73301",
"notes": "Submitted application for the UI Designer role."
}
}
}
]
},
```

#### Contact Errors
401 Error Response if no token provided: