MutacjaBetaMutation.createClientContact
Adds a contact person to a client. It needs at least a name, an e-mail or a phone. With isPrimary, it becomes the primary contact instead of the previous one.
| Wymagany zakres | clients:write |
|---|---|
| Dostępne od | Prynt 0.28.0 |
| Stabilność | Beta (co to znaczy) |
| Ponawianie | Wysyłaj nagłówek Idempotency-Key, żeby ponowienie nie wykonało zapisu drugi raz. Zapisy i idempotencja |
Argumenty
| Nazwa | Typ | Opis |
|---|---|---|
clientIdwymagane | ID! | Identifier of the client. |
inputwymagane | ClientContactInput! | The new contact person. |
Zwraca
Przykład
mutation CreateClientContact($clientId: ID!, $input: ClientContactInput!) { createClientContact(clientId: $clientId, input: $input) { id firstName lastName email role isPrimary }}{ "clientId": "6c2e4a1b-7d3f-4e5a-9b8c-0d1e2f3a4b5c", "input": { "firstName": "Anna", "lastName": "Zając", "phone": "+48 600 100 200", "role": "Zakupy", "isPrimary": true }}IDEMPOTENCY_KEY=$(uuidgen) # ponawiaj z tym samym kluczem
curl -sS https://twoja-drukarnia.prynt.pl/api/v1/graphql \ -H "Authorization: Bearer $PRYNT_API_KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: $IDEMPOTENCY_KEY" \ --data-binary @- <<'JSON'{ "query": "mutation CreateClientContact($clientId: ID!, $input: ClientContactInput!) {\n createClientContact(clientId: $clientId, input: $input) {\n id\n firstName\n lastName\n email\n role\n isPrimary\n }\n}", "variables": { "clientId": "6c2e4a1b-7d3f-4e5a-9b8c-0d1e2f3a4b5c", "input": { "firstName": "Anna", "lastName": "Zając", "email": "[email protected]", "phone": "+48 600 100 200", "role": "Zakupy", "isPrimary": true } }}JSON{ "data": { "createClientContact": { "id": "7d3f5b2c-8e4a-4f6b-9c0d-1e2f3a4b5c6d", "firstName": "Anna", "lastName": "Zając", "role": "Zakupy", "isPrimary": true } }}